biodiverse / ubms

Fit models to data from unmarked animals using Stan. Uses a similar interface to the R package 'unmarked', while providing the advantages of Bayesian inference and allowing estimation of random effects.
https://hmecology.github.io/ubms/
GNU General Public License v3.0
35 stars 8 forks source link

Add K-fold cross-validation method #65

Closed kenkellner closed 1 year ago

kenkellner commented 2 years ago

Mainly useful when results from LOO aren't satisfactory. Also replaces storage of log likelihood values in the model object with log likelihoods calculated when needed, which cuts down on model size about two thirds. Fixes #62.

codecov-commenter commented 2 years ago

Codecov Report

Merging #65 (0a98a37) into master (9213a62) will decrease coverage by 0.16%. The diff coverage is 97.94%.

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
- Coverage   99.05%   98.89%   -0.17%     
==========================================
  Files          32       35       +3     
  Lines        2019     2348     +329     
==========================================
+ Hits         2000     2322     +322     
- Misses         19       26       +7     
Impacted Files Coverage Δ
R/loglik.R 95.58% <95.58%> (ø)
src/loglik.cpp 98.06% <98.06%> (ø)
R/fit.R 100.00% <100.00%> (ø)
R/fitlist.R 100.00% <100.00%> (ø)
R/inputs.R 98.86% <100.00%> (+0.05%) :arrow_up:
R/kfold.R 100.00% <100.00%> (ø)
R/missing.R 100.00% <100.00%> (ø)
R/spatial.R 100.00% <100.00%> (ø)
R/submodel.R 100.00% <100.00%> (ø)
R/ubmsFit-methods.R 97.22% <100.00%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9213a62...0a98a37. Read the comment docs.