| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Package BysPrior = |
| 4 | |
| 5 | BysPriorInf stands for Bayesian Prior Information and allows to define prior |
| 6 | information handlers to be used in estimation systems (max-likelihood and |
| 7 | bayesian ones). |
| 8 | |
| 9 | A prior is a distribution function over a subset of the total set of variables |
| 10 | of a model that expresses the knowledge about the phenomena behind the model. |
| 11 | |
| 12 | The effect of a prior is to add the logarithm of its likelihood to the |
| 13 | logarithm of the likelihood of the global model. So it can be two or |
| 14 | more priors over some variables. For example, in order to stablish a |
| 15 | truncated normal we can define a uniform over the feasible region and |
| 16 | an unconstrainined normal. |
| 17 | |
| 18 | In order to be estimated with NonLinGloOpt (max-likelihood) and BysSampler |
| 19 | (Bayesian sampler), each prior must define methods to calculate the logarithm |
| 20 | of the likelihood (except an additive constant), its gradient and its hessian, |
| 21 | and an optional set of constraining inequations, in order to define the feasible |
| 22 | region. Each inequation can be linear or not and the gradient and hessian must |
| 23 | be also calculated. Note that this implies that priors should be continuous and |
| 24 | two times differentiable but this an admisible restricion in almost all cases. |
| 25 | |
| 26 | == Non informative priors == |
| 27 | |
| 28 | Let [[LatexEquation( \beta )]] a uniform random variable in a region |
| 29 | [[LatexEquation(\Omega\in\mathbb{R}^{n} )]] which likelihood function is [[BR]] |
| 30 | |
| 31 | [[LatexEquation(lk\left(\beta\right) \propto 1 )]] |
| 32 | |
| 33 | Since the logarithm of the likelihood but a constant is zero, when |
| 34 | log-likelihood is not defined for a prior, the default assumed will be the |
| 35 | uniform distribution, also called non informative prior. |
| 36 | |
| 37 | === Domain prior === |
| 38 | The easiest way, but one of the most important, to define non informative |
| 39 | prior information is to stablish a domain interval for one or more variables. |
| 40 | |
| 41 | In this cases, you mustn't to define the log-logarithm nor the constraining |
| 42 | inequation functions, but simply it's needed to fix the lower and upper |
| 43 | bounds:[[BR]][[BR]] |
| 44 | |
| 45 | [[LatexEquation( \beta\in\Omega\Longleftrightarrow l_{k}\leq\beta\leq u_{k}\wedge-\infty\leq l_{k}<u_{k}\leq\infty )]] |
| 46 | |
| 47 | === Polytope prior === |
| 48 | A polytope is defined by a system of arbitrary linear inequalities |
| 49 | |
| 50 | [[LatexEquation( A\beta\leq a\wedge A\in\mathbb{R}^{r\times n}\wedge a\in\mathbb{R}^{r} )]] |