momentuHMM initialization #84
-
In applying momentuHMM on a dataset comprised of subtracks from several collared individuals, I have 6 random effect terms that I would like to include/test for: sex, age, body condition, antibody titre, group size, and presence of juveniles in group. In attempting to test one of the above random effects, I am struggling with the actual application of training the model with fitHMM because I do not understand how to utilize the mixture feature or how to obtain initial parameter values for the regression coefficients of the transition probabilities (beta0 values) per mixture. I would certainly appreciate your assistance with this and thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
The random effects in momentuHMM >=1.5.0 are discrete-valued and at the individual level (sensu McKellar et al., Towner et al., and DeRuiter et al.). They are specified via the 'mixtures' and 'formulaPi' arguments in the fitHMM and MIfitHMM functions. So if one wants, say, 2 mixtures with sex effects on the mixture probabilities, then one would specify mixtures = 2 and formulaPi = ~SEX. One could also include 'SEX' in the 'formula' argument to include fixed sex effects on both the t.p.m. and mixture probabilities. Covariate terms can only be included as fixed effects in 'formula', 'formulaDelta', and 'formulaPi' (and covariates that change over time should not be included in 'formulaPi'). Choosing "good" starting values can be challenging, particularly for beta0 TheoMichelot/moveHMM#15 (comment). When fitting models in momentuHMM, it's generally best to start by fitting simple models and build up to more complicated models. For example, first fit a basic model (e.g. with few states, no random effects, and no covariates) and make sure it appears to have converged (e.g. using the 'retryFits' argument; see section 5 in this moveHMM vignette for more on what 'retryFits' is doing). Once a simpler model has been fit (possibly after trying lots of different starting values for all parameters), then the getPar0 function can be used to get starting values for more complicated models such as those that include covariates, random effect mixtures, or additional states, and these models can also be fit using 'retryFits' to help make sure they have converged. Then just continue building up to the most complicated models in this iterative fashion. This technique is demonstrated in several of the vignette examples, including the elephant, southern elephant seal, and pilot whale examples. |
Beta Was this translation helpful? Give feedback.
-
I have obtained the first basic model (with no random effects and no covariates) that has successfully converged. I used the getPar0 function to obtain the starting values to train the next model with 2 mixtures, however I still need to provide 2 sets of beta0 values. When I inspect the object returned from getPar0, I see two groups of beta values, but the second group is all zeros - how do I obtain the beta0 values for the second group? Looking at the Pilot Whale example (pilotWhaleExample.R), it is not clear to me where the values on line 49 come from. |
Beta Was this translation helpful? Give feedback.
-
The pilot whale analysis was originally performed by Isojunno et al., so their parameter estimates were already available to use as starting values. This was done in pilotWhaleExample.R simply to speed up the optimization (i.e., by starting the optimization close to the MLEs). In general, one doesn't necessarily need to set any beta0 values, but the default starting values generated by getPar0 (or fitHMM) may not be "good" ones. It can be difficult to set good starting values for beta0 in more complex models, but you could try and set them based on your best guess. If you have no idea what would constitute decent starting values for beta0, then I would suggest the brute force strategy described above. |
Beta Was this translation helpful? Give feedback.
The random effects in momentuHMM >=1.5.0 are discrete-valued and at the individual level (sensu McKellar et al., Towner et al., and DeRuiter et al.). They are specified via the 'mixtures' and 'formulaPi' arguments in the fitHMM and MIfitHMM functions. So if one wants, say, 2 mixtures with sex effects on the mixture probabilities, then one would specify mixtures = 2 and formulaPi = ~SEX. One could also include 'SEX' in the 'formula' argument to include fixed sex effects on both the t.p.m. and mixture probabilities. Covariate terms can only be included as fixed effects in 'formula', 'formulaDelta', and 'formulaPi' (and covariates that change over time should not be included in 'formulaPi').
C…