Initial values in WinBUGS -



Initial values in WinBUGS -

i gave values stochastic nodes, winbugs still gives me message chain contains uninitialized variables. when seek generate it, bugs gives me error undefined real result. node missing here?

model { # population model start on 1 of oct 2014 # initial numbers in each age class f1.2014 <- 4 # no. first-year females oct 2014 f2.2014 <- 2 # no. older females oct 2014 f.2014 <- f1.2014+f2.2014 # total no. of females in oct 2014 f.trans <- 15 # no. of trans. juv females in march 2015 f2[1] ~ dbin(phi.af.annual, f.2014) # sample number older females live oct 2015 (12 mo) mutot.2014 <- mu.1*f1.2014+mu.2*f2.2014 # expected number of fledglings 2014/15 j.2014 ~ dpois(mutot.2014) # sample actual number of fledglings jf.2014 ~ dbin(0.5,j.2014) # sample no. juv females in jan 2015 phi.trans<-pow((phi.jf.mo),6) # probability trans juvs survive march oct f1.trans ~ dbin(phi.trans, f.trans) # sample no. translocated female juven in oct 2015 f1.juvs ~ dbin(phi.jf,jf.2014) # sample no. female juven in oct 2015 f1[1]<-f1.juvs+f1.trans # total number of first year birds in oct 2015 f[1] <- f1[1]+f2[1] pe[1] <- step(-f[1]) # prob extinction oct 2015 # run simulations 20 years (i in 1:20) { mutot[i] <- mu.1*f1[i]*mu.2*f2[i] # expected number of total fledglings females j[i] ~ dpois(mutot[i]) # sample total fledglings jf[i] ~ dbin(0.5,j[i]) # sample number female fledglings f1[i+1] ~ dbin(phi.jf,jf[i]) # sample number female recruits next year f2[i+1] ~ dbin(phi.af.annual,f[i]) # sample number adult females survive next year f[i+1] <- f1[i+1]+f2[i+1] # total number of females next year pe[i+1] <- step(-f[i+1]) # prob population extinct next year } } # info list(phi.af.annual=0.6, mu.1=2.5, mu.2=3.1, phi.jf.mo=0.8, phi.jf=0.87) # inits list(f1=c(na, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), f2=c(na, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), f1.trans=10, f1.juvs=6, j.2014=20, jf.2014=10, j=c(10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10), jf=c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5) )

winbugs

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -