likelihood_LVvmarg_draw.jsodm_lv: Likelihood Computation for JSODM_LV Model for a Given Draw

View source: R/likelihood_jsodm_lv.R

likelihood_LVvmarg_draw.jsodm_lvR Documentation

Likelihood Computation for JSODM_LV Model for a Given Draw

Description

Computes the joint-species LV-marginal likelihood for all ModelSites, for a given draw.

Usage

likelihood_LVvmarg_draw.jsodm_lv(
  Xocc,
  Xobs,
  y,
  ModelSite,
  occ.b,
  det.b,
  lv.b,
  numlvsims,
  simseed = NULL
)

Arguments

Xocc

A matrix of processed occupancy covariate values for the model site. Must have 1 row.

Xobs

A matrix of processed detection covariate values for each visit to the model site.

y

Matrix of species detections for each visit to the model site.

occ.b_arr

Occupancy covariate loadings. Each row is a species, each column an occupancy covariate, each layer (dim = 3) is a draw

det.b_arr

Detection covariate loadings. Each row is a species, each column an detection covariate, each layer (dim = 3) is a draw

lv.b_arr

LV loadings. Each row is a species, each column a LV, each layer (dim = 3) is a draw

data_i

A row of a data frame created by prep_data_by_modelsite. Each row contains data for a single ModelSite.

lvsim

A matrix of simulated LV values. Columns correspond to latent variables, each row is a simulation


sustainablefarms/msod documentation built on March 6, 2023, 7:17 a.m.