CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc: Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDesc* TextModels.StdModelDescTextModels.ModelDesc4,TextModels.AttributesDesc'* *ntF#------------------------------------------------------------------------------------------------------------------------------ Version 1 #------------------------------------------------------------------------------------------------------------------------------ model { # stochastic part of the likelihood for (k in 1:YEARS){ y[k] ~ dbin( pi[k], N[k] ) } # deterministic part of the likelihood for (k in 2:YEARS){ pi[k]<-pi[k-1]*R[k] } # prior for pi[1] pi[1] ~ dbeta( 0.01, 0.01) # dummy value for R[1] R[1] <- 1 # Prior for R[k] for (k in 2:YEARS){R[k] ~ dgamma( 0.01, 0.01) } for (k in 1:YEARS){index[k] <-k } } DATA list(YEARS=8) y[] N[] 554 1183 701 1510 749 1597 868 1924 516 1178 573 1324 978 2173 399 845 END INITS list(pi=c(0.5, NA, NA, NA, NA, NA, NA, NA), R=c(NA, 1,1,1,1,1,1,1) ) list(pi=c(0.1, NA, NA, NA, NA, NA, NA, NA), R=c(NA, 1,1,1,1,1,1,1) ) list(pi=c(0.9, NA, NA, NA, NA, NA, NA, NA), R=c(NA, 1,1,1,1,1,1,1) ) #------------------------------------------------------------------------------------------------------------------------------ Version 2 #------------------------------------------------------------------------------------------------------------------------------ model { # stochastic likelihood part for the first observation y[1] ~ dbin( pi[1], N[1] ) for (k in 2:YEARS){ # stochastic part of the likelihood y[k] ~ dbin( pi[k], N[k] ) # deterministic part of the likelihood pi[k]<-pi[k-1]*R[k] # Prior for R[k] R[k] ~ dgamma( 0.01, 0.01) } # dummy value for R[1] R[1] <- 1 # prior for pi[1] pi[1] ~ dbeta( 0.01, 0.01) } DATA list(YEARS=8, y=c(554,701,749,868,516,573,978,399), N=c(1183,1510,1597,1924,1178,1324,2173, 845) ) INITS list(pi=c(0.5, NA, NA, NA, NA, NA, NA, NA), R=c(NA, 1,1,1,1,1,1,1) ) TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo * ,[ @Documents.ControllerDesc t]s ' `h*