Learn R Programming

growfunctions (version 0.1)

gmrfdpPost: Run a Bayesian functional data model under an instrinsic GMRF prior whose precision parameters employ a DP prior

Description

An internal function to gmrfdpgrow

Usage

gmrfdpPost(y, ipr, C, D, q_order, q_type, n.iter, n.burn, n.thin, M_init,
  q_shape, q_rate, tau_shape, tau_rate, dp_shape, dp_rate, progress, jitter,
  kappa_fast)

Arguments

y
An N x T matrix of N observations of T x 1 functions
ipr
An optional input vector of inclusion probabilities for each observation unit in the case the observed data were acquired through an informative sampling design, so that unbiased inference about the population requires adjustments to the observed sample
C
A list object of length, K, the number of iGMRF precision terms. Each entry contains a T x T normalized adjacency matrix. The diagonal entries are 0 and row i contains the weight for each entry {!=i} divi
D
A K x T matrix, where K denotes the number of iGMRF terms. Row k contains the T elements of the diagonal of the term-k precision matrix, Q_k. Will increase with order and be equa
q_order
An integer vector where each entry contains the order of the associated K iGMRF precision terms matrix of Euclidean distances associated to each seasonal covariance term.
q_type
A vector of length K, the number of iGMRF precision terms, with each entry indicating whether the associated term is a trend ("tr") or seasonality ("sn") term.
tau_shape
The value (in (0,infty)) for the shape hyperparameter for the Gamma prior on the error precision parameter. Defaults to tau_shape = 1.0.
tau_rate
The rate parameter of the Gamma prior distribution on tau_e. Defaults to tau_rate = 1.
n.iter
The number of MCMC sampling iterations
n.burn
The number of warm-up iterations to discard
n.thin
The interval or step size of post-burn-in samples to return
M_init
Starting value of number of clusters for sampling cluster assignments.
q_shape
The shape parameter of the Gamma base distribution for the kappa_star locations used to sample the DP prior on the P GP covariance parameters, kappa, for each experimental unit.
q_rate
The rate parameter of the Gamma base distribution for the kappa_star locations used to sample the DP prior on the P GP covariance parameters, kappa, for each experimental unit.
dp_shape
The shape parameter for the $\Gamma$ prior on the DP concentration parameter. The rate parameter is set of 1.
dp_rate
The rate parameter for the $\Gamma$ prior on the DP concentration parameter. Default value is 1.
progress
An indicator in {0,1} denoting whether to display a progress bar during model execution. progress = 1 displays a progress bar. Defaults to progress = 1.
jitter
A scalar double indicating amount of jitter to subract from the posterior rate and shape hyperparameters of tau_e to stabilize computation. Defaults to jitter = 0.0.
kappa_fast
Boolean for whether to generate rate hyperparameter from full conditionals versus joint Gaussian (on random effects, bb, given kappa. The former is faster, but numerically less stable. Defaults to kappa_fast = FALSE

Value

  • res A list object containing MCMC runs for all model parameters.

See Also

gpdpgrow