Commit a4a4407c authored by matbuoro's avatar matbuoro
Browse files

updated for 2016

parent 66d74bf6
OpenBUGS did not run correctly.
......@@ -33,23 +33,27 @@ source(paste('parameters_',stade,'.R',sep="")) # chargement des paramètres
#------------------------INITS----------------------------------##
#if(!file.exists(paste('inits/inits_',stade,year,'.Rdata',sep=""))){
if(!file.exists(paste("inits/init-",site,"-",stade,year,".txt",sep=""))){
source(paste('inits/inits_',stade,'.R',sep="")) # création des inits des données
#}
load(paste('inits/inits_',stade,year,'.Rdata',sep=""))
#load(paste('inits/inits_',stade,year,'.Rdata',sep=""))
}
#load(paste('inits/inits_',stade,'.Rdata',sep="")) # chargement des inits
#if(site == "Bresle" && stade == "adult") {inits <- list(read.bugsdata(paste("inits/init-",site,"-",stade,year,".txt",sep="")))}
#if(site == "Nivelle") {inits <- list(read.bugsdata(paste("inits/init-",site,"-",stade,year,".txt",sep="")))}
if(site == "Nivelle") {inits <- list(read.bugsdata(paste("inits/init-",site,"-",stade,year,".txt",sep="")))}
#------------------------MODEL----------------------------------##
model <- paste("model/",stade,"-",site,".txt",sep="") # path of the model
model <- paste("model/model_",stade,"-",site,".R",sep="") # path of the model
if(site == "Scorff" && stade == "smolt") {model <- paste("model/",stade,"-",site,"_",year,".R",sep="")} # le modèle Scorrf pour les smolt peut changer tous les ans suivant conditions
model
filename <- file.path(work.dir, model)
#system(paste("cp",model,paste(stade,"-",site,".txt",sep=""),sep=""))
#---------------------------ANALYSIS-----------------------------##
nChains = length(inits) # Number of chains to run.
adaptSteps = 1000 # Number of steps to "tune" the samplers.
nburnin=500 # Number of steps to "burn-in" the samplers.
nstore=5000 # Total number of steps in chains to save.
nstore=1000 # Total number of steps in chains to save.
nthin=1 # Number of steps to "thin" (1=keep every step).
#nPerChain = ceiling( ( numSavedSteps * thinSteps ) / nChains ) # Steps per chain.
......@@ -60,17 +64,22 @@ start.time = Sys.time(); cat("Start of the run\n");
fit <- bugs(
data
,inits
,model.file = model
,model.file = filename
,parameters
,n.chains = nChains, n.iter = nstore + nburnin, n.burnin = nburnin, n.thin = nthin
,DIC=FALSE
,codaPkg = FALSE, clearWD=TRUE
,codaPkg = FALSE, clearWD=FALSE
#,debug=TRUE
,working.directory=work.dir
,working.directory=paste(work.dir,"bugs",sep="/")
)
## cleaning
system("rm bugs/CODA*")
# save last values for inits
#if(site == "Nivelle") {save(fit$save.states,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))}
#inits <- fit$last.values
#if(site == "Nivelle") {save(inits,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))}
#bugs.inits(inits, n.chains=1,digits=3, inits.files = paste('inits/init-',site,'-',stade,year,'.txt',sep=""))
######### JAGS ##########
## Compile & adapt
......
This diff is collapsed.
OpenBUGS version 3.2.3 rev 1012
model is syntactically correct
data loaded
model compiled
initial values loaded but chain contain uninitialized variables
initial values generated, model initialized
500 updates took 18 s
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
monitor set
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
inference can not be made when sampler is in adaptive phase
1000 updates took 38 s
CODA files written
no monitors set
modelCheck('model/tacon-Nivelle.txt')
modelData('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/data.txt')
modelCheck('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/bugs/model_tacon-Nivelle.R.txt')
modelData('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/bugs/data.txt')
modelCompile(1)
modelSetRN(1)
modelInits('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/inits1.txt',1)
modelInits('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/bugs/inits1.txt',1)
modelGenInits()
modelUpdate(500,1,500)
samplesSet(mu_p_srem)
......@@ -67,7 +67,7 @@ summarySet(jres_ns_runs)
summarySet(dj)
summarySet(dj_nat)
summarySet(dj_comp)
modelUpdate(5000,1,5000)
samplesCoda('*', '/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon//')
modelUpdate(1000,1,1000)
samplesCoda('*', '/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Nivelle/tacon/bugs//')
summaryStats('*')
modelQuit('y')
This diff is collapsed.
......@@ -12,9 +12,9 @@
load(paste('data/data_',stade,"_",year,'.Rdata',sep=""))
#------------------------INITS----------------------------------##
#inits0 <- read.bugsdata(paste("inits/init-",site,"-",stade,as.numeric(year)-1,".txt",sep=""))
inits0 <- read.bugsdata(paste("inits/init-",site,"-",stade,as.numeric(year)-1,".txt",sep=""))
#save(inits0,file=paste('inits/inits_',stade,as.numeric(year)-1,'.Rdata',sep=""))
load(paste('inits/inits_',stade,as.numeric(year)-1,'.Rdata',sep=""))
#load(paste('inits/inits_',stade,as.numeric(year)-1,'.Rdata',sep=""))
###################################################
# NO UPDATE
......@@ -589,4 +589,5 @@ inits <- list(c( inits_fix,inits_updated))
#write(inits[[1]],file=paste("inits/init-",site,"-",stade,year,".txt",sep=""), append=TRUE)
#lapply(inits[[1]], write, paste("inits/init-",site,"-",stade,year,".txt",sep=""), append=TRUE)
#save(inits,file=paste('inits/inits_',stade,'.Rdata',sep=""))
save(inits,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))
#save(inits,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))
bugs.inits(inits, n.chains=1,digits=3, inits.files = paste('inits/init-',site,'-',stade,year,'.txt',sep=""))
This diff is collapsed.
OpenBUGS version 3.2.3 rev 1012
model is syntactically correct
data loaded
model compiled
expected the collection operator c error pos 88 (error on line 1)
unable to generate initial values for node <alpha_dj[7]> of type UpdaterSlice.Left
model must be initialized before updating
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before monitors used
model must be initialized before updating
model must be initialized before monitors used
model must be initialized before monitors used
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment