CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDescv TextModels.StdModelDescTextModels.ModelDesc x jTextModels.AttributesDesc1$Courier New  1$Courier New < CourierPS1 CourierPS  #------------------------------------------------------------------------------------------------------------------------------ Version 1 #------------------------------------------------------------------------------------------------------------------------------ model{ # model's likelihood for (i in 1:n){ y[i]~dnorm( mu, tau ) y.rep[i]~dnorm( mu, tau ) } # # log-normal prior mu ~ dnorm( 0.0, 0.001) tau ~ dgamma( 0.001, 0.001 ) s<-1/sqrt(tau) # # predictive cummulative frequencies for each y_i for (i in 1:n){ for (k in 1:n){ pred.lower.yi[i,k] <- step( y[i] - y.rep[k] ) } F.pred[i] <- sum( pred.lower.yi[i,1:n] )/n } #-------------------------------------------------------------------------- # residuals for (i in 1:n){ # ordered replicated/predicted data ordered.y.rep[i]<- ranked( y.rep[1:n], i ) ordered.y[i] <- ranked( y[1:n], i ) rs[i] <- (y[i]-mu)*sqrt(tau) pr[i] <- step(y.rep[i]-y[i]) pro[i]<- step(ordered.y.rep[i]-ordered.y[i]) } } INITS list( mu=0.0, tau=1 ) DATA1 (LIST) list( n=19, y=c(0.51, 0.1, -2.53, 1, 0.65, -0.95, 2.76, 1.33, 0.25, 1.48, -0.25, -0.45, 2.11, -0.76, -1.51, -0.35, 0.18, 1.35, -0.18) ) DATA2 (LIST) list( n=20, y=c(0.51, 0.1, -2.53, 1, 0.65, -0.95, 2.76, 1.33, 0.25, 1.48, -0.25, -0.45, 2.11, -0.76, -1.51, -0.35, 0.18, 1.35, -0.18, 5) ) DATA3 (LIST) list( n=20, y=c(0.51, 0.1, -2.53, 1, 0.65, -0.95, 2.76, 1.33, 0.25, 1.48, -0.25, -0.45, 2.11, -0.76, -1.51, -0.35, 0.18, 1.35, -0.18, 10) ) DATA4 (from log(gamma(2,1)) list(n=19, y=c(1.43, 1.16, 1.64, 1.06, -1.76, -0.29, -1.37, -0.72, -0.94, 1.2, 1.41, 0.74, 0.77, 0.71, 1.83, 1.58, 0.18, 0.18, 1.43)) list(n=100, y=c(2.02, 0, 0.34, 0.19, 0.03, 0.02, 0.01, 0.21, 0.04, 0, 0, 0.79, 0, 0.04, 0.01, 0.04, 0, 0.22, 0.03, 0.04, 0, 0.11, 0, 0.1, 0.31, 0.05, 0.13, 0, 0.67, 0.06, 0.08, 0.26, 0, 0, 0, 0, 0.05, 0.98, 0.06, 0, 0, 0, 0, 1.07, 0.08, 0, 0, 2.11, 0, 0.01, 0, 0, 0.01, 0, 0.01, 0.48, 0.07, 0, 0, 0.22, 0.06, 0, 0, 0, 0, 0.04, 0.49, 1.36, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0.06, 0.01, 0, 0.66, 0.24, 0.02, 0.02, 0.05, 0, 0.15, 0.07, 2.34, 0, 0.02, 0.12, 0.38, 0, 0.02, 0.01, 0, 0.79, 0.03, 0.21)) TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo * ,[ @Documents.ControllerDesc t]s ' `h*