Skip to content

Commit

Permalink
bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hughes authored and Hughes committed Oct 2, 2024
1 parent 4aef690 commit c5634ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions inst/templates/JAGS_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for(k in 1:nYears){

#Recruitment
for(k in 1:nYears){
mu.R[k] <- composition.bias*max(0.01,min(0.99,exp(l.R + anthro[k]*beta.Rec.anthro + fire[k]*beta.Rec.fire)))
mu.R[k] <- max(0.01,min(0.99,exp(l.R + anthro[k]*beta.Rec.anthro + fire[k]*beta.Rec.fire)))
#Constrain sd of beta distribution to what is theoretically possible, given mu
sig.R[k] <- min(cv.R*mu.R[k],0.99*(mu.R[k]*(1-mu.R[k]))^0.5)
#Get beta distribution parameters from mean and sd
Expand All @@ -33,7 +33,7 @@ for(k in 1:nYears){

#Growth
for(k in 1:nYears){
Rfemale[k] <- R[k]/2
Rfemale[k] <- composition.bias*R[k]/2
survivors[k] ~ dbin( S.annual.KM[k], fpop.size[k] )
recruits[k] ~ dbin(Rfemale[k],survivors[k])
pop.growthr[k] <- S.annual.KM[k]*(1+Rfemale[k]) #without demographic stochasticity
Expand Down
4 changes: 2 additions & 2 deletions inst/templates/JAGS_template2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ for(k in 1:nYears){

#Recruitment
for(k in 1:nYears){
R[k] <- composition.bias*max(0.01,min(0.99,exp(l.R + anthro[k]*beta.Rec.anthro + fire[k]*beta.Rec.fire)))
R[k] <- max(0.01,min(0.99,exp(l.R + anthro[k]*beta.Rec.anthro + fire[k]*beta.Rec.fire)))
}

#Growth
for(k in 1:nYears){
Rfemale[k] <- R[k]/2
Rfemale[k] <- composition.bias*R[k]/2
survivors[k] ~ dbin( S.annual.KM[k], fpop.size[k] )
recruits[k] ~ dbin(Rfemale[k],survivors[k])
pop.growthr[k] <- S.annual.KM[k]*(1+Rfemale[k]) #without demographic stochasticity
Expand Down

0 comments on commit c5634ec

Please sign in to comment.