Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tidy to sdmTMB_cv #319

Open
ericward-noaa opened this issue Mar 11, 2024 · 1 comment
Open

Add tidy to sdmTMB_cv #319

ericward-noaa opened this issue Mar 11, 2024 · 1 comment

Comments

@ericward-noaa
Copy link
Collaborator

Request to generate tables of quantities of interest: fold log likelihoods, etc

@seananderson
Copy link
Member

I wrote a little print method for cross validation. Example:

#> fit

Cross validation of sdmTMB models with 2 folds.

Summary of the first fold model fit:

Spatial model fit by ML ['sdmTMB']
Formula: density ~ 0 + depth_scaled + depth_scaled2
Family: tweedie(link = 'log')
 
              coef.est coef.se
depth_scaled     -1.78    0.20
depth_scaled2    -1.49    0.12

Dispersion parameter: 13.20
Tweedie p: 1.62
Matérn range: 142.03
Spatial SD: 2.47
ML criterion at convergence: 3153.366

See ?tidy.sdmTMB to extract these values as a data frame.

Access the rest of the models in a list element named `models`.
E.g. `object$models[[2]]` for the 2nd fold model fit.

1 out of 2 models are consistent with convergence.
Figure out which folds these are in the `converged` list element.

Out-of-sample log likelihood for each fold: -3438.85, -3225.47.
Access these values in the `fold_loglik` list element.

Sum of out-of-sample log likelihoods: -6664.32 
More positive values imply better out-of-sample prediction.
Access this value in the `sum_loglik` list element.

I can also do a little tidy method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants