priorcontrol: Prior information for the DDPstar model

View source: R/priorcontrol.R

priorcontrolR Documentation

Prior information for the DDPstar model

Description

This function is used to set various parameters controlling the prior information to be used in the DDPstar function.

Usage

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)

Arguments

m0

A numeric vector. Hyperparameter; mean vector of the (multivariate) normal prior distribution for the parametric coefficients. NA signals autoinitialization, with defaults: a vector, of length Q (where Q is the number of parametric coefficients), of zeros, if the data are standardised and the least squares estimates of the regression coefficients if the data are not standardised.

S0

A numeric matrix. Hyperparameter; covariance matrix of the (multivariate) normal prior distribution for the parametric coefficients. NA signals autoinitialization, with defaults: 10I_{Q\times Q} if the data are standardised (where Q is the number of parametric coefficients) and \mathbf{\hat{\Sigma}} if the data are not standardised, where \mathbf{\hat{\Sigma}} is the estimated covariance matrix of the parametric coefficients obtained by fitting a linear model to the data.

nu

A numeric value. Hyperparameter; degrees of freedom of the Wishart prior distribution for the precision matrix associated with the parametric coefficients. NA signals autoinitialization, with default Q+2 (where Q is the number of parametric coefficients)

Psi

A numeric matrix. Hyperparameter; scale matrix of the Wishart prior distribution for the precision matrix associated with the parametric coefficients. NA signals autoinitialization, with defaults: I_{Q\times Q} if the data are standardised (where Q is the number of parametric coefficients) and to 30\mathbf{\hat{\Sigma}} if the data are not standardised, where \mathbf{\hat{\Sigma}} is the estimated covariance matrix of the parametric coefficients obtained by fitting a linear model to the data.

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. NA signals autoinitialization, with defaults: 0.5 if the data are standardised and \frac{\hat{\sigma}^2}{2} if the data are not standardised

alpha.fixed

A logical value. If TRUE, the precision parameter of the Dirichlet Process is considered fixed. If FALSE, a Gamma prior distribution is placed on it.

alpha

A numeric value. Applicable when alpha.fixed = TRUE. Precision parameter of the Dirichlet Process. The default is 1.

aalpha

A numeric value. Applicable when alpha.fixed = FALSE. Hyperparameter; shape parameter for the Gamma prior distribution of the precision parameter of the Dirichlet process prior. The default is 2.

balpha

A numeric value. Applicable when alpha.fixed = FALSE. Hyperparameter; rate parameter for the Gamma prior distribution of the precision parameter of the Dirichlet process prior. The default is 2.

L

A numeric value. Upper bound on the number of mixture components. Setting L = 1 corresponds to a normal model. The default is 10.

Value

A list with components for each of the possible arguments.

See Also

DDPstar

Examples

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)



DDPstar documentation built on April 3, 2025, 8:46 p.m.