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

WAIC on lognormal Poisson models #44

Closed
rburner opened this issue Apr 14, 2020 · 13 comments
Closed

WAIC on lognormal Poisson models #44

rburner opened this issue Apr 14, 2020 · 13 comments

Comments

@rburner
Copy link

rburner commented Apr 14, 2020

Hi,

A quick question about calculating WAIC - the computeWAIC() function works fine on my probit models, but throws an NaN on my lognormal poisson models. Is this a bug, or does the WAIC function not work on these models?

Thanks again for developing the HMSC package and all your work improving it and answering questions.

Best,

Ryan

@ovaskain
Copy link
Collaborator

ovaskain commented Apr 14, 2020 via email

@rburner
Copy link
Author

rburner commented Apr 14, 2020

@ovaskain Thanks Otso, I'll give some simple models a try with the new CRAN version and see what happens.
Best,
Ryan

@rburner rburner closed this as completed Apr 14, 2020
@rburner
Copy link
Author

rburner commented Apr 20, 2020

I seem to still be getting the same problem...would it be possible for me to replace any infinities and -Inf's with some arbitrarily large numbers to make the calculations work? How bad of an idea is this?

Any tips on where in the fitted model object I can find those numbers? Thanks!

@rburner rburner reopened this Apr 20, 2020
@ovaskain
Copy link
Collaborator

ovaskain commented Apr 20, 2020 via email

@rburner
Copy link
Author

rburner commented Apr 20, 2020

Hi Otso,

Thanks, that would be great! I'll work on getting a fast example to send.

Best,
Ryan

@rburner
Copy link
Author

rburner commented Apr 23, 2020

Hi Otso,

Any luck with that example file I sent? I just reran a model with more samples and am still getting NaN for the WAIC.

Thanks,

Ryan

@hmsc-r
Copy link
Owner

hmsc-r commented Apr 27, 2020

I studied your example. The main problem is that log-normal Poisson model is very difficult to fit (e.g. in terms of MCMC convergence) and model fit can be bad. With log-normal Poisson, it is very important to study model fit, by e.g. comparing the data to predicted values. If predicted values are 100 times greater than the data, then something is obviously not well (and this can easily happen). I added to computeWAIC na.rm = TRUE, so now it should give a number. However, that number will not be meaningful if the MCMC has not converged and/or the model fit is not good.

@rburner
Copy link
Author

rburner commented Apr 27, 2020

Otso,

Thanks so much for the help - yes, that's an important reminder to always check model fit. I will take a look and see what is going on.

Best,

Ryan

@rburner rburner closed this as completed Apr 27, 2020
@rburner
Copy link
Author

rburner commented Apr 27, 2020

Now most of my models are giving me 'Inf' as a WAIC...I guess that is just another indication of poor fit? But in some cases couldn't it be just a small subset of species that were responsible for the problems?

@ovaskain
Copy link
Collaborator

ovaskain commented Apr 28, 2020 via email

@rburner
Copy link
Author

rburner commented Apr 28, 2020

Great, thanks so much for that! I'll use it with due caution.

So I guess the sum of those species-specific WAIC values would be the WAIC value that was previously reported by the function? What would be the most appropriate summary of those values then when comparing models? Maybe median, to reduce the effect of outlier species?

Incidentally, I also compared the absolute values of species' responses to an influential covariate in one of my models with their WAIC and also found a relationship, which is good:

WAIC_rb

@ovaskain
Copy link
Collaborator

ovaskain commented Apr 28, 2020 via email

@rburner
Copy link
Author

rburner commented Apr 28, 2020

Ok, thank you!

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

3 participants