Analysis Tips - dattalab/moseq2-app GitHub Wiki

Recommended Practice for Modeling

Fitting the AR-HMM typically requires adjusting the kappa hyperparameter to achieve a target syllable duration (higher values of kappa lead to longer syllable durations). The target duration can be determined using changepoints analysis or set heuristically to 0.3-0.4 seconds based on prior literature.

kappa affects the syllable duration and the effect of kappa is linear in log space. Changing kappa from 100,000 to 1,000,000 is the same as 10,000 to 100,000. You can set kappa to 'scan' to run a family of models with different kappa values and use the "Get Best Model Fit" cell to pick a value automatically. We recommend fitting for 100-200 iterations to pick kappa.

Once you have a set of parameters for the model, for final model fitting, we recommend training 100 models with the same parameters and for ~1000 iterations. After all the models are trained, you can use get the best model fit to find the best model that matches the changepoints while capturing additional behavioral information.

Get Best Model Fit

Get best model fit is used to determine whether the trained model has captured median syllable durations that match the principal components' changepoints. If there are more than one trained models in progress_paths['base_model_path'], the feature returns the best model that matches the principal components' changepoints from a list of models.

The command supports comparison with respect to two objectives: duration and jsd. duration finds the model where the median syllable duration best matches that of the principal components' changepoints. jsd finds the model where the distribution of syllable durations best match that of the principal components' changepoints.

If there are multiple models in the inputted folder, then the outputted figure will plot multiple dashed distribution curves representing distributions of unselected models and 2 solid distribution curves that show the "Best"/chosen model and the principal compoments' changepoint durations.

Below are examples of some comparative distributions that you can expect when using this tool: