Q_matrix_linear: Calculate the Q matrix for a model with only linear terms.

Description Usage Arguments Value

View source: R/03-latent-variables.R

Description

Calculate the Q-matrix (joint prior precision matrix) of the latent Gaussian variables. This is a function of theta. Functions are provided for Q-matrices with linear terms only, RW2 terms only, and both.

Note that the linear terms' prior covariance matrix is fixed (a true prior) and its log-precision is specified directly in the model setup. Hence the Q_matrix_linear function does not take an argument for this parameter.

Usage

1
2
3
4
5
6
7
8
9
Q_matrix_linear(model_data, tau = exp(12))

Q_matrix_rw2_one_component(theta, model_data, covariate)

Q_matrix_rw2(theta, model_data, tau = exp(12))

Q_matrix_both(theta, model_data, tau = exp(12))

Q_matrix(theta, model_data, tau = exp(12))

Arguments

model_data

A cc_modeldata object returned by model_setup()

tau

The precision of the auxillary epsilon variables. Set it to something huge. Default exp(12).

theta

Hyperparameter, scalar, the log-precision of the RW2 model.

covariate

String naming the covariate from the data for which the precision matrix should be calculated.

Value

A sparse matrix inheriting from class CsparseMatrix containing the joint precision matrix of the latent Gaussian variables.


awstringer1/casecrossover documentation built on March 11, 2021, 4:41 a.m.