Commit ce7c70df authored by kunstler's avatar kunstler
Browse files

fixe bug stan

parent 27a601a1
......@@ -85,7 +85,7 @@ run.stan <- function (model.file, trait, init.TF,
ecocode.var = 'wwf',
var.sample = NA, chain_id =NA,
parallel.TF = TRUE, select.biome = NA,
select.set = NA,
select.set = NA, merge.biomes.TF = FALSE,
chains = 3,
...) {
require(rstan)
......@@ -103,7 +103,8 @@ run.stan <- function (model.file, trait, init.TF,
sample.size. = sample.size,
ecocode.var. = ecocode.var,
Multi.type. = Multi.type,
sample.vec.TF. = FALSE)
sample.vec.TF. = FALSE,
merge.biomes.TF = merge.biomes.TF)
cat("Ok data with Nobs", stan.list$N_indiv, 'init',
"\n")
}
......@@ -113,7 +114,8 @@ run.stan <- function (model.file, trait, init.TF,
sample.size. = sample.size,
ecocode.var. = ecocode.var,
Multi.type. = Multi.type,
sample.vec.TF. = TRUE)
sample.vec.TF. = TRUE,
merge.biomes.TF = merge.biomes.TF)
cat("Ok data with Nobs", stan.list$N_indiv, 'run real',
"\n")
if(parallel.TF){
......@@ -123,8 +125,7 @@ run.stan <- function (model.file, trait, init.TF,
var.sample = var.sample,
ecocode.var = ecocode.var,
list.sd = stan.list[[2]],
chains = chains,
...)
chains = chains)
}else{
fun.call.stan.parallel.and.save(stan.model = model,
list.stan = stan.list[[1]],
......@@ -132,8 +133,7 @@ run.stan <- function (model.file, trait, init.TF,
chain_id = chain_id,
var.sample = var.sample,
ecocode.var = ecocode.var,
list.sd = stan.list[[2]],
...)
list.sd = stan.list[[2]])
}
}
gc()
......
Markdown is supported
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