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 R2 function #256

Open
seananderson opened this issue Sep 13, 2023 · 3 comments
Open

Add R2 function #256

seananderson opened this issue Sep 13, 2023 · 3 comments

Comments

@seananderson
Copy link
Member

seananderson commented Sep 13, 2023

Integrate work @maxlindmark and @federico-maioli sent me (thanks!), which includes R2 for other families:
https://gist.github.com/seananderson/96c36fae8d23879e388aa7ab9a601f60

Edit: don't use the above, use the newer: https://github.com/pbs-assess/sdmTMB/blob/main/scratch/r2-glmm.qmd

@seananderson
Copy link
Member Author

I believe this needs the variance from the smoothers included. We'd need to multiply the basis functions by their corresponding penalized coefficients + add on any linear component. Alternatively, as an easy hack, we could predict without standard errors and without any random effects and call all that the 'fixed effect' component if there are smoothers.

@seananderson
Copy link
Member Author

I have done a bunch of work on this in this file:
https://github.com/pbs-assess/sdmTMB/blob/main/scratch/r2-glmm.qmd
including adding smoothers, changing how the distribution variance is calculated, and checking against the performance package/glmmTMB.

@seananderson
Copy link
Member Author

I've taken a first stab at bringing the r2.sdmTMB() function into the package. See progress here: https://github.com/pbs-assess/sdmTMB/compare/r2?expand=1 which compares the 'r2' branch with 'main'.

Still to do:

  • add NB2, NB1
  • add spatially varying coefficients
  • add support for delta models (start with just each separately)

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

1 participant