Description Usage Arguments Value Author(s) References Examples
Prepare the given prior settings for internal use in INLA. The input of the function makePriors
are prior settings for variances and correlation or the full covariance matrix, these are then transformed to the internal parameterisation that INLA requires. This function is used internally in the main function meta4diag()
but can also be used as a separate function.
1 2 3 | makePriors(var.prior = "PC", var2.prior="PC", cor.prior = "PC",
var.par = c(3, 0.05), var2.par, cor.par = c(1,-0.1,0.5,-0.95,0.05,0.95,0.05),
wishart.par = c(4,1,1,0), init = c(0.01, 0.01, -0.1))
|
var.prior |
A string specifying the prior density for the first variance component, options are "PC" for penalised complexity prior, "Invgamma" for inverse gamma prior, "Tnormal" for truncated normal prior, "Unif" for uniform prior which allow the standard deviation uniformaly distributed on [0,1000], "Hcauchy" for half-cauchy prior and "table" for user specific prior.
|
var2.prior |
See |
cor.prior |
A string specifying the prior density for the correlation, options are "PC" for penalised complexity prior, "Invgamma" for inverse gamma prior, "Beta" for beta prior and "table" for user specific prior.
|
var.par |
A numerical vector specifying the parameter of the prior density for the first variance component.
See also argument |
var2.par |
A numerical vector specifying the parameter of the prior density for the second variance component. If not given, function will copy the setting for the first variance component. The definition of the priors is the same as for |
cor.par |
A numerical vector specifying the parameter of the prior density for the correlation. See also
See also argument |
wishart.par |
A numerical vector specifying the parameter of the prior density for the covariance matrix. |
init |
A numerical vector specifying the initial value of the first variance, the second variance and correlation. |
A list of prior settings with the components:
prec1 |
a list of prior settings for the first log precision (the log inverse of the first variance in the model). |
prec2 |
a list of prior settings for the second log precision (the log inverse of the second variance in the model). |
cor |
a list of prior settings for the transformed correlation (some functions of correlation in the model). |
lambdas |
a vector of rate parameters for the PC correlation if |
density |
a list of prior densities for precisions and correlations. |
original.setting |
a list of input prior settings. |
wishart.flag |
Boolean indicating whether a inverse Wishart prior is setting or not. |
Jingyi Guo and Andrea Riebler
Simpson DP, Martins TG, Riebler A, Fuglstad GA, Rue H, Sorbye SH (2014) Penalised Model Component Complexity: A principled, Practical Approach to Constructing Priors. Arxiv e-prints. 1403.4630
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
if(requireNamespace("INLA", quietly = TRUE)){
require("INLA", quietly = TRUE)
makePriors(var.prior = "PC", cor.prior = "PC", var.par = c(3, 0.05),
cor.par = c(1, -0.1, 0.5, -0.95, 0.05, NA, NA))
makePriors(var.prior = "PC", cor.prior = "PC", var.par = c(3, 0.05),
cor.par = c(2, -0.1, 0.5, NA, NA, 0.95, 0.05))
makePriors(var.prior = "PC", cor.prior = "PC", var.par = c(3, 0.05),
cor.par = c(3, -0.1, NA, -0.95, 0.05, 0.95, 0.05))
makePriors(var.prior = "invgamma", cor.prior = "normal",
var.par = c(0.25, 0.025), cor.par = c(0, 5))
makePriors(var.prior = "invwishart", wishart.par=c(4,1,2,0.1))
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.