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 laplace prior #64

Closed JustinCally closed 2 years ago

JustinCally commented 2 years ago

Addition of laplace prior as per #63

kenkellner commented 2 years ago

This looks great! Thank you. And sorry I didn't respond to your related issue more quickly.

Would you mind adding a quick test for the R function like these ones?

https://github.com/kenkellner/ubms/blob/074be5504491afa296557215afc77f5ad9c98688/tests/testthat/test_priors.R#L3

JustinCally commented 2 years ago

Thanks Ken,

Added a test for the laplace prior. I've tried looking into adding a horseshoe prior as well but it didn't seem as straightforward as the laplace prior so I left it for the moment.

codecov-commenter commented 2 years ago

Codecov Report

Merging #64 (be881d0) into master (074be55) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #64   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files          32       32           
  Lines        2015     2019    +4     
=======================================
+ Hits         1996     2000    +4     
  Misses         19       19           
Impacted Files Coverage Δ
R/priors.R 100.00% <100.00%> (ø)

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 074be55...be881d0. Read the comment docs.

kenkellner commented 2 years ago

Thanks, really appreciate it!