Skip to content

Indices of random effects (RE) in stan output for mixture models like beta_gamma model #189

Answered by seananderson
xsswang asked this question in Q&A
Discussion options

You must be logged in to vote

The random intercepts appear to get appended one column after the other into a vector. Here's an example:

library(sdmTMB)
library(tmbstan)

pcod$fyear <- as.factor(pcod$year)
fit <- sdmTMB(
  density ~ 1 + (1 | fyear),
  data = pcod,
  family = delta_gamma(),
  spatial = "off" # fast example
)
fit
#> Model fit by ML ['sdmTMB']
#> Formula: density ~ 1 + (1 | fyear)
#> Mesh: NULL (isotropic covariance)
#> Data: pcod
#> Family: delta_gamma(link1 = 'logit', link2 = 'log')
#> 
#> Delta/hurdle model 1: -----------------------------------
#> Family: binomial(link = 'logit') 
#>             coef.est coef.se
#> (Intercept)    -0.15    0.09
#> 
#> Random intercepts:
#>       Std. Dev.
#> fyear     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by seananderson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #187 on March 09, 2023 01:17.