GLMEM_objfn: Objective function for the BayesGLM EM algorithm

View source: R/EM_utils.R

GLMEM_objfnR Documentation

Objective function for the BayesGLM EM algorithm

Description

This returns the negative of the expected log-likelihood function.

Usage

GLMEM_objfn(theta, spde, model_data, Psi, K, A, n_threads = NULL, Ns = NULL)

Arguments

theta

a vector containing kappa2, phi, and sigma2, in that order

spde

the spde object

model_data

the model_data object containing y and X

Psi

a conversion matrix (N by V) (or N by n)

K

number of covariates

A

The value for Matrix::crossprod(X%*%Psi) (saves time on computation)

n_threads

Needed for SQUAREM (it is an argument to the fixed-point functions)

Ns

The number of samples used to approximate traces using the Hutchinson estimator. If set to 0, the exact trace is found.

Value

A scalar value for the negative expected log-likelihood


mandymejia/BayesfMRI documentation built on April 12, 2025, 3:44 p.m.