View source: R/likelihood_jsodm_lv.R
likelihood.jsodm_lv | R Documentation |
Computes the likelihood of observations at each ModelSite. At data in the fitted model, or on new data supplied. It uses likelihood_joint_LVvmarg_draw.jsodm_lv.
## S3 method for class 'jsodm_lv' likelihood( fit, numlvsims = 1000, cl = NULL, simseed = NULL, reps = ceiling(numlvsims/100), chunksize = 100 )
numlvsims |
the number of simulated latent variable values to use for computing likelihoods |
cl |
a cluster created by parallel::makeCluster() |
reps |
divides the work into |
chunksize |
divides the work up by |
chains |
is a vector indicator which mcmc chains to extract draws from. If NULL then all chains used. |
Returns a matrix. Each row corresponds to a draw of the parameters from the posterior. Each column to a ModelSite. The value in each cell is the probability density, given the parameters from the draw, evaluated at the observations for the model site.
fit <- readRDS("../sflddata/private/data/testdata/cutfit_7_4_11_2LV.rds") fit <- translatefit(fit) cl <- parallel::makeCluster(1) lkl <- likelihood(fit, numlvsims = 10, cl = cl, chunksize = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.