Regional-Fish-Modeling / Sampling-Design

Evaluating spatial and temporal sampling designs to estimate trends in Brook Trout abundance
MIT License
0 stars 2 forks source link

Seasonal covariates for abundance #3

Open ykanno opened 8 years ago

ykanno commented 8 years ago

I uploaded a model which includes seasonal weather covariates for abundance. I have convergence and "Failure to calculate log density" error issues. I have then deleted some random effects and used tighter priors to solve the issue, but no success thus far. I am still working on it. One JAGS output example of a failed run is below:

out2 <- jags(dat, init, pars, paste("bkt trend power weather cov model.r", sep=""),

  • n.chains=3, n.thin=10, n.iter=60000, n.burnin=30000, parallel=TRUE)

Processing function input.......

Done.

Beginning parallel processing using 3 cores. Console output will be suppressed.

Parallel processing completed.

Calculating statistics.......

Done.

print(out2, dig=3) JAGS output for model 'bkt trend power weather cov model.r', generated by jagsUI. Estimates based on 3 chains of 60000 iterations, burn-in = 30000 iterations and thin rate = 10, yielding 9000 total samples from the joint posterior. MCMC ran in parallel for 105.759 minutes at time 2016-04-01 10:37:34.

             mean         sd      2.5%       50%      97.5% overlap0     f    Rhat n.eff

mu 3.975 0.614 2.666 3.808 4.992 FALSE 1.000 3.080 4 trend 0.018 0.086 -0.088 -0.018 0.157 TRUE 0.402 8.487 3 sd.site 0.828 0.057 0.706 0.828 0.944 FALSE 1.000 1.138 190 sd.year 1.018 0.620 0.225 0.881 1.979 FALSE 1.000 7.240 3 sigma 0.989 0.714 0.468 0.490 2.000 FALSE 1.000 175.590 3 p.mean 0.507 0.222 0.200 0.632 0.703 FALSE 1.000 11.769 3 p.b 2.941 4.150 -0.116 0.049 9.461 TRUE 0.823 25.051 3 mu.b[1] -0.009 0.093 -0.268 0.021 0.093 TRUE 0.333 1.838 6 mu.b[2] -0.745 0.783 -2.370 -0.268 -0.080 FALSE 0.998 5.888 3 mu.b[3] 0.262 0.302 0.013 0.078 0.906 FALSE 0.992 5.443 3 mu.b[4] 0.379 0.380 0.053 0.146 1.174 FALSE 1.000 5.752 3 mu.b[5] 0.061 0.085 -0.116 0.049 0.288 TRUE 0.899 1.331 28 mu.b[6] 0.576 0.650 0.029 0.170 1.890 FALSE 0.992 6.670 3 sigma.b[1] 0.334 0.442 0.001 0.037 1.115 FALSE 1.000 12.057 3 sigma.b[2] 0.674 0.895 0.002 0.060 1.995 FALSE 1.000 38.604 3 sigma.b[3] 0.566 0.744 0.002 0.060 1.804 FALSE 1.000 17.520 3 sigma.b[4] 0.463 0.618 0.003 0.040 1.485 FALSE 1.000 18.121 3 sigma.b[5] 0.483 0.660 0.002 0.026 1.557 FALSE 1.000 20.712 3 sigma.b[6] 0.625 0.803 0.007 0.089 1.949 FALSE 1.000 16.750 3 deviance 119126.240 127444.583 28178.612 31181.704 348014.485 FALSE 1.000 10.494 3

WARNING Rhat values indicate convergence failure. Rhat is the potential scale reduction factor (at convergence, Rhat=1). For each parameter, n.eff is a crude measure of effective sample size.

overlap0 checks if 0 falls in the parameter's 95% credible interval. f is the proportion of the posterior with the same sign as the mean; i.e., our confidence that the parameter is positive or negative.

DIC info: (pD = var(deviance)/2) pD = 240865855 and DIC = 240984981 DIC is an estimate of expected predictive error (lower is better).

djhocking commented 8 years ago

Evan and I talked yesterday after the meeting. It seems like there are just too many similar random effects: site, year, site-year, + 6 randomly varying climate effects. The first thing to try would be to remove the site-year random effect (eps[i,j]). That way we might be able to leave in the random effect of climate variables so we can understand how variable those effects are in space, since that is one of our primary questions of interest. If that doesn't work, the making those fixed would be the next step (but adding eps[i,j] back in).

ykanno commented 8 years ago

Thanks Dan and Evan. I had started a model before I saw your email. I will try your suggestion, but for the model I just ran, I had retained eps[i.j] and used a constant effect size of climate variables across sites. The model now converged. But I did not see any change in year random effect (sd.year) - originally our assumption was that the year random effect would reduce by incorporating seasonal climate variables. Not only that, site random effect (sd.year) or over-dispersion random effect (sigma) did not change either. I have attached two r markdown files, one without seasonal covariates and one with them. Please scroll to the bottom of the files and locate values for sd.year, sd.site and sigma. What are we missing? Was our assumption of reducing year random effect not correct?

On Thu, Mar 31, 2016 at 10:22 AM, Daniel J. Hocking < notifications@github.com> wrote:

Evan and I talked yesterday after the meeting. It seems like there are just too many similar random effects: site, year, site-year, + 6 randomly varying climate effects. The first thing to try would be to remove the site-year random effect (eps[i,j]). That way we might be able to leave in the random effect of climate variables so we can understand how variable those effects are in space, since that is one of our primary questions of interest. If that doesn't work, the making those fixed would be the next step (but adding eps[i,j] back in).

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/Regional-Fish-Modeling/Sampling-Design/issues/3#issuecomment-203961052