Description Usage Arguments Value
Fit a hierarchical Bayesian structural equation model to data on pre-spawning mortality and landscape and climatic variables using Stan.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | sem_psm(
psm,
X,
normal_indx,
gamma_indx,
L = 1,
fit = NULL,
I0_Z = 1,
I_su = 1,
I_su_Z = 1,
I_fa = 1,
I_fa_Z = 1,
I_fit = rep(1, nrow(psm)),
I_lpd = rep(1, nrow(psm)),
pars = c("a0", "A", "Z", "phi", "g_mu_X", "mu_b0", "b0_Z", "sigma_b0", "b0",
"mu_b_su", "b_su_Z", "sigma_b_su", "b_su", "mu_b_fa", "b_fa_Z", "sigma_b_fa", "b_fa",
"sigma_psm", "p_psm", "ll_psm"),
chains = 3,
iter = 12000,
warmup = 2000,
thin = 5,
...
)
|
psm |
A data frame with rows corresponding to observations, including columns named
|
X |
A matrix with rows corresponding to sites and columns corresponding to landscape variables, to be modeled as either normal- or gamma-distributed. |
normal_indx |
An integer vector giving indices of columns of |
gamma_indx |
An integer vector giving indices of columns of |
L |
Integer giving the number of latent landscape factors to fit. |
fit |
Stanfit object as returned by a previous call to |
I0_Z |
Integer (0/1) indicating whether to include main effects of latent landscape factors on pre-spawning mortality risk. |
I_su |
Integer (0/1) indicating whether to include a main effect of summer precipitation on pre-spawning mortality risk. |
I_su_Z |
Integer (0/1) indicating whether to include interactions between summer precipitation and latent landscape factors on pre-spawning mortality risk. |
I_fa |
Integer (0/1) indicating whether to include a main effect of fall precipitation on pre-spawning mortality risk. |
I_fa_Z |
Integer (0/1) indicating whether to include interactions between fall precipitation and latent landscape factors on pre-spawning mortality risk. |
I_fit |
Integer vector (0/1) of length |
I_lpd |
Integer vector (0/1) of length |
pars |
A character vector specifying parameters of interest to be saved. |
chains |
A positive integer specifying the number of Markov chains. |
iter |
A positive integer specifying the number of iterations for each chain (including warmup). |
warmup |
A positive integer specifying the number of warmup (aka burnin) iterations per chain. |
thin |
A positive integer specifying the period for saving samples. |
... |
Other arguments to be passed to |
An object of S4 class rstan::stanfit.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.