-
Notifications
You must be signed in to change notification settings - Fork 7
Description
library(bayesMig) , library(devtools), library(usethis)
quand j'ai essayé de suivre ce code :
sim.dir <- tempfile() # Répertoire pour stocker les résultats
Exécuter 4 MCMC avec 10 000 itérations chacune, avec un amincissement de 10
m <- run.mig.mcmc(nr.chains = 4, iter = 10000, thin = 10, output.dir = sim.dir, verbose.iter = 1000)
Prédiction pour tous les pays
pred <- mig.predict(sim.dir = sim.dir, nr.traj = 1000, burnin = 5000)
il me donne :
m <- run.mig.mcmc(nr.chains = 2, iter = 30, thin = 1, my.mig.file = us.mig.file,
-
output.dir = sim.dir, present.year = 2017, annual = TRUE)
Starting Bayesian Hierarchical Model Migration.
Initialize simulation - 2 chain(s) in total.
Chain nr. 1
Starting values:
mu a
-0.1 1.1
Store initial values into mc1
Flushing results into disk.
Start sampling - 30 iterations in total.
Iteration: 10 -- Sat Aug 31 19:27:57 2024
Iteration: 20 -- Sat Aug 31 19:27:57 2024
Iteration: 30 -- Sat Aug 31 19:27:57 2024
Flushing results into disk.
Chain nr. 2
Starting values:
mu a
0.1 5.0
Store initial values into mc2
Flushing results into disk.
Start sampling - 30 iterations in total.
Iteration: 10 -- Sat Aug 31 19:27:59 2024
Iteration: 20 -- Sat Aug 31 19:27:59 2024
Iteration: 30 -- Sat Aug 31 19:27:59 2024
Flushing results into disk.
Results stored in C:\Users\ASUS\AppData\Local\Temp\RtmpeECAst\file2b28412a7a2b
Simulation successfully finished!!!
Prediction
pred <- mig.predict(sim.dir = sim.dir, burnin = 5, end.year = 2050)
Loading chain 1 from disk. (mcmc.list[[ 1 ]]).
Loading chain 2 from disk. (mcmc.list[[ 2 ]]).
Prediction from 2018 until 2050 (i.e. 33 projections)
Storing thinned mcmc:
Storing country-independent parameters ...done.
Storing country-specific parameters ...done.
Projecting migration trajectories ... 100 %
1 data points reconstructed for -0.001000186122
1 data points reconstructed for -0.001488464531
Creating summary files ...
Erreur dans cbind(this.result1, proj.result) :
le nombre de lignes des matrices doit correspondre (voir argument 2)