priorcontrol | R Documentation |
This function is used to set various parameters controlling the prior information to be used in the DDPstar
function.
priorcontrol(m0 = NA, S0 = NA, nu = NA, Psi = NA,
atau = 1, btau = 0.005, a = 2, b = NA, alpha.fixed = FALSE,
alpha = 1, aalpha = 2, balpha = 2, L = 10)
m0 |
A numeric vector. Hyperparameter; mean vector of the (multivariate) normal prior distribution for the parametric coefficients. |
S0 |
A numeric matrix. Hyperparameter; covariance matrix of the (multivariate) normal prior distribution for the parametric coefficients. |
nu |
A numeric value. Hyperparameter; degrees of freedom of the Wishart prior distribution for the precision matrix associated with the parametric coefficients. |
Psi |
A numeric matrix. Hyperparameter; scale matrix of the Wishart prior distribution for the precision matrix associated with the parametric coefficients. |
atau |
A numeric value. Hyperparameter; shape parameter of the gamma prior distribution for the precisions (inverse variances) of the smooth/nonlinear/random terms. The default is 1. |
btau |
A numeric value. Hyperparameter; rate parameter of the gamma prior distribution for the precisions (inverse variances) of the smooth/nonlinear/random terms. The default is 0.005. |
a |
A numeric value. Hyperparameter; shape parameter of the gamma prior distribution for the precisions (inverse variances) of each component. The default is 2. |
b |
A numeric value. Hyperparameter; shape parameter of the gamma prior distribution for the precisions (inverse variances) of each component. |
alpha.fixed |
A logical value. If |
alpha |
A numeric value. Applicable when |
aalpha |
A numeric value. Applicable when |
balpha |
A numeric value. Applicable when |
L |
A numeric value. Upper bound on the number of mixture components. Setting L = 1 corresponds to a normal model. The default is 10. |
A list with components for each of the possible arguments.
DDPstar
library(DDPstar)
data(dde)
dde$GAD <- dde$GAD/7 # GAD in weeks
prior <- priorcontrol(a = 2, b = 0.5, aalpha = 2, balpha = 2, L = 20)
set.seed(10) # For reproducibility
fit_dde <- DDPstar(formula = GAD ~ f(DDE, bdeg = 3, nseg = 20, pord = 2, atau = 1, btau = 0.005),
data = dde, mcmc = list(nburn = 20000, nsave = 15000, nskip = 1), prior = prior,
standardise = TRUE, compute.lpml = TRUE, compute.WAIC = TRUE, compute.DIC = TRUE)
summary(fit_dde)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.