Regional-Fish-Modeling / Spatial-Analysis

Spatial analysis of brook trout count data: INLA, semivariograms, etc
0 stars 0 forks source link

Add random slope effect #2

Open tywagner opened 8 years ago

tywagner commented 8 years ago

Yoichiro et al., During our call last week, we talked briefly about (potentially) adding a random slope effect to the N-Mix model, rather than assuming all sites have the same trend. Although I think the consensus is that there may not be a lot of among-site trend variation, I think it would be useful/interesting to quantify this variance component. If all sites are doing the same thing over time (or not) that's important to know. Below is some code that I think should do the trick (just showing the linear predictor and the random slope prior, etc). I did not push a new R script since I did not test this. We can decide to do this or not as a group, just thought I would follow-up on this topic.

Abundance model

for(i in 1:nSites){
  for(j in 1:nYears){
    N[i,j] ~ dpois(lambda[i,j])
    log(lambda[i,j]) <- mu + (trend + slope.ran[i])*(j-1) + site.ran[i,j] + year.ran[j] + eps[i,j]
  }
}

for(i in 1:nSites) {
slope.ran[i] ~ dnorm(0,tau.slope) # random slope effects

}

sd.slope ~ dunif(0,10) tau.slope <- pow(sd.slope,-2) ….

ykanno commented 8 years ago

That's right. I like the idea.

bletcher commented 8 years ago

I like it too.

On Wed, Jan 27, 2016 at 8:56 AM, Yoichiro Kanno notifications@github.com wrote:

That's right. I like the idea.

— Reply to this email directly or view it on GitHub https://github.com/Regional-Fish-Modeling/Spatial-Analysis/issues/2#issuecomment-175638560 .

Silvio O. Conte Anadromous Fish Research Center, U.S. Geological Survey P.O. Box 796 -- One Migratory Way Turners Falls, MA 01376 (413) 863-3803 Cell: (413) 522-9417 FAX (413) 863-9810

ben_letcher@usgs.gov bletcher@eco.umass.edu http://www.lsc.usgs.gov/?q=cafb-research