dmvn_smw: dmvn_smw_mra

View source: R/dmvn_smw.R

dmvn_smwR Documentation

dmvn_smw_mra

Description

dmvn_smw_mra

Usage

dmvn_smw(
  y,
  X,
  beta,
  tW,
  tWW,
  Q_alpha_tau2,
  sigma2,
  Rstruct = NULL,
  logd = TRUE
)

Arguments

y

is a n vector of Gaussian data.

X

is a n \times p matrix of fixed effects (like latitude, elevation, etc)

beta

is the regression parameter beta

tW

is the transpose of the sparse Wendland basis matrix of class spam

tWW

is the transpose of the sparse Wendland basis matrix multiplied by itself of class spam

Q_alpha_tau2

is the prior precision matrix for random effects alpha

sigma2

is the residual error

Rstruct

is the Cholesky prior precision matrix for random effects alpha

logd

is a logical value of whether to calculate the log density (logd = TRUE) or the density on the data scale (logd = FALSE)

Value

The (log) density of a normal distribution with mean \mathbf{X} \boldsymbol{\beta} and covariance matrix \sigma^2 \mathbf{I} + \mathbf{W} \mathbf{Q}_{\alpha_{\tau^2}} \mathbf{W}'


jtipton25/BayesMRA documentation built on Feb. 28, 2024, 1:27 p.m.