Commit 0892e66c authored by matbuoro's avatar matbuoro
Browse files

Update 2016

parent 0f53962d
......@@ -12,14 +12,13 @@ library(mcmcplots)
##-----------------------------INFO ----------------------------------##
year <- "2015"
year <- "2016"
site <- "Oir"
stade <- "adult"
## WORKING DIRECTORY:
work.dir<-paste("~/Documents/RESEARCH/PROJECTS/ORE/Abundance",site,stade,sep="/")
#work.dir<-paste("/media/ORE/Abundance",site,stade,sep="/")
work.dir<-paste("/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance",site,stade,sep="/")
setwd(work.dir)
......@@ -55,8 +54,8 @@ filename <- file.path(work.dir, model)
#---------------------------ANALYSIS-----------------------------##
nChains = length(inits) # Number of chains to run.
adaptSteps = 1000 # Number of steps to "tune" the samplers.
nburnin=5000 # Number of steps to "burn-in" the samplers.
nstore=10000 # Total number of steps in chains to save.
nburnin=500 # Number of steps to "burn-in" the samplers.
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.
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ modelCompile(1)
modelSetRN(1)
modelInits('/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Oir/adult/bugs/inits1.txt',1)
modelGenInits()
modelUpdate(5000,1,5000)
modelUpdate(500,1,500)
samplesSet(logit_int_MC)
samplesSet(logit_flow_MC)
samplesSet(sigmap_eff)
......@@ -61,7 +61,7 @@ summarySet(Nesc_1SW)
summarySet(Nesc_MSW)
summarySet(Nesc_tot)
summarySet(test)
modelUpdate(10000,1,10000)
modelUpdate(1000,1,1000)
samplesCoda('*', '/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance/Oir/adult/bugs//')
summaryStats('*')
modelQuit('y')
......@@ -12,19 +12,19 @@ heidel.diag also implements a convergence diagnostic, and removes up to half the
Stationarity start p-value
test iteration
shape_lambda passed 1 0.298
rate_lambda passed 1 0.224
p_MC90_1SW passed 1 0.848
p_MC90_MSW passed 1 0.596
lambda0 passed 1 0.310
shape_lambda passed 1 0.391
rate_lambda passed 1 0.454
p_MC90_1SW passed 1 0.849
p_MC90_MSW passed 1 0.168
lambda0 passed 1 0.775
Halfwidth Mean Halfwidth
test
shape_lambda passed 3.7786 0.089681
rate_lambda passed 0.0172 0.000451
p_MC90_1SW passed 0.1253 0.005723
p_MC90_MSW passed 0.2955 0.014528
lambda0 passed 221.5138 7.184882
shape_lambda passed 3.6712 0.24009
rate_lambda passed 0.0169 0.00127
p_MC90_1SW failed 0.1253 0.01344
p_MC90_MSW failed 0.3227 0.03972
lambda0 passed 228.7220 17.24491
---------------------------
Geweke's convergence diagnostic
......@@ -40,7 +40,7 @@ Fraction in 1st window = 0.1
Fraction in 2nd window = 0.5
shape_lambda rate_lambda p_MC90_1SW p_MC90_MSW lambda0
0.492 0.258 0.541 0.800 -0.964
1.490 1.692 -0.998 -0.606 -0.246
---------------------------
......@@ -49,12 +49,5 @@ Raftery and Lewis's diagnostic
Quantile (q) = 0.025
Accuracy (r) = +/- 0.005
Probability (s) = 0.95
Burn-in Total Lower bound Dependence
(M) (N) (Nmin) factor (I)
shape_lambda 18 20262 3746 5.41
rate_lambda 16 16250 3746 4.34
p_MC90_1SW 18 19480 3746 5.20
p_MC90_MSW 20 27940 3746 7.46
lambda0 15 14655 3746 3.91
You need a sample size of at least 3746 with these values of q, r and s
This diff is collapsed.
This diff is collapsed.
......@@ -18,12 +18,10 @@ stade <- "smolt"
## WORKING DIRECTORY:
work.dir<-paste("/media/ORE/Abundance",site,stade,sep="/")
work.dir<-paste("/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance",site,stade,sep="/")
setwd(work.dir)
##-----------------------------DATA ----------------------------------##
source(paste('data/data_',stade,'.R',sep="")) # creation du fichier Rdata
load(paste('data/data_',stade,"_",year,'.Rdata',sep="")) # chargement des données
......@@ -52,6 +50,7 @@ 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.
......@@ -79,10 +78,12 @@ fit <- bugs(
## cleaning
system("rm bugs/CODA*")
### Save inits ###
# save last values for inits
#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=""))
# inits <- fit$last.values
# if(site == "Nivelle") {
# save(inits,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))
# }
######### JAGS ##########
......
=============================
DIAGNOSTICS
=============================
---------------------------
Heidelberger and Welch's convergence diagnostic
heidel.diag is a run length control diagnostic based on a criterion of relative accuracy for the estimate of the mean. The default setting corresponds to a relative accuracy of two significant digits.
heidel.diag also implements a convergence diagnostic, and removes up to half the chain in order to ensure that the means are estimated from a chain that has converged.
Stationarity start p-value
test iteration
logit_int_MC passed 10001 0.2179
logit_flow_MC passed 1 0.8625
log_cess_MC passed 5001 0.0701
shape_lambda passed 1 0.5142
rate_lambda passed 1 0.4328
mean_gamma passed 5001 0.0628
var_gamma passed 1 0.1757
Halfwidth Mean Halfwidth
test
logit_int_MC passed 5.04e-01 1.88e-03
logit_flow_MC passed -9.29e-02 1.77e-03
log_cess_MC passed 8.23e-02 5.87e-03
shape_lambda passed 2.43e+00 1.70e-02
rate_lambda passed 2.02e-03 1.58e-05
mean_gamma passed 1.22e+03 1.81e+00
var_gamma passed 6.66e+05 6.26e+03
---------------------------
Geweke's convergence diagnostic
Geweke (1992) proposed a convergence diagnostic for Markov chains based on a test for equality of the means of the first and last part of a Markov chain (by default the first 10% and the last 50%).
If the samples are drawn from the stationary distribution of the chain, the two means are equal and Geweke's statistic has an asymptotically standard normal distribution.
The test statistic is a standard Z-score: the difference between the two sample means divided by its estimated standard error. The standard error is estimated from the spectral density at zero and so takes into account any autocorrelation.
The Z-score is calculated under the assumption that the two parts of the chain are asymptotically independent, which requires that the sum of frac1 and frac2 be strictly less than 1.
Fraction in 1st window = 0.1
Fraction in 2nd window = 0.5
logit_int_MC logit_flow_MC log_cess_MC shape_lambda rate_lambda
-2.6156 -0.9555 -1.5303 -0.5214 -0.8994
mean_gamma var_gamma
2.7947 1.2894
---------------------------
Raftery and Lewis's diagnostic
Quantile (q) = 0.025
Accuracy (r) = +/- 0.005
Probability (s) = 0.95
Burn-in Total Lower bound Dependence
(M) (N) (Nmin) factor (I)
logit_int_MC 4 4998 3746 1.330
logit_flow_MC 4 7816 3746 2.090
log_cess_MC 6 8810 3746 2.350
shape_lambda 12 16992 3746 4.540
rate_lambda 16 18980 3746 5.070
mean_gamma 2 3718 3746 0.993
var_gamma 12 17676 3746 4.720
......@@ -43,8 +43,10 @@ The Z-score is calculated under the assumption that the two parts of the chain a
Fraction in 1st window = 0.1
Fraction in 2nd window = 0.5
logit_int_MC logit_flow_MC log_cess_MC shape_lambda rate_lambda mean_gamma var_gamma
0.262 1.687 -3.009 0.433 0.419 -0.502 -0.640
logit_int_MC logit_flow_MC log_cess_MC shape_lambda rate_lambda
0.262 1.687 -3.009 0.433 0.419
mean_gamma var_gamma
-0.502 -0.640
---------------------------
......
"mean";"sd";"2.5%";"25%";"50%";"75%";"97.5%"
"logit_int_MC";0.5023031028;0.117703452192881;0.2686;0.4247;0.503;0.5807;0.7328025
"logit_flow_MC";-0.0928773023758;0.121398268428649;-0.3308;-0.1729;-0.09402;-0.01338;0.1487
"log_cess_MC";0.0813266096998;0.258422076877372;-0.4437025;-0.0893;0.08857;0.2592;0.5708025
"shape_lambda";2.427642098;0.596501852025581;1.422;2.004;2.369;2.79524996646496;3.74202499674363
"rate_lambda";0.00201597549;0.000551468468509393;0.001097;0.001621;0.001961;0.002351;0.003246
"mean_gamma";1222.156874;148.328753811027;965.1;1119;1211;1312;1548
"var_gamma";665997.714;258453.82259379;332400;490500;613000;778900.000000001;1303000
"lambda[1]";753.298224;66.3802688820086;638.6;707.1;747.8;794.1;899.602499864533
"lambda[2]";369.221162;44.3624960545603;298.1;337.8;363.9;394.5;473.202499742481
"lambda[3]";419.257306;43.0759078197901;345.8;388.9;415.5;445.4;514.5
"lambda[4]";833.514676;83.6766226359462;693.9;775.2;824.3;882;1023
"lambda[5]";824.160522;54.1821798847172;736.397499834484;786.7;818;854.2;947.9
"lambda[6]";205.208272;26.7285684521533;161.2;186.5;202.3;220.7;266.3
"lambda[7]";682.542794;51.5327601995181;596.6;646.6;677.2;712.7;798.6
"lambda[8]";232.761336;22.417758813345;195.4;217.3;230.6;245.6;283.8
"lambda[9]";606.941238;136.314488650413;414.8;507.9;582.7;676.9;939.8
"lambda[10]";749.813302;52.8268332568122;659.6;712.6;745.5;781.824998800934;866.602499859375
"lambda[11]";1010.588762;74.5961009589169;884.2;958.9;1003;1055;1176
"lambda[12]";480.043632;76.0260296332264;358.8;426.4;470.2;523.024998207657;657.40249981463
"lambda[13]";1080.64566;123.597203603234;870.097499859919;994.6;1069;1154;1355
"lambda[14]";267.551524;27.8298604685704;219.3;248.1;265.5;284.8;328.4
"lambda[15]";2170.23558;73.4030364642965;2033;2120;2168;2218;2323
"lambda[16]";1362.0783;104.088843104605;1175;1291;1357;1426;1584
"lambda[17]";2368.54838;79.0891782821015;2219;2314;2366;2420.24996126967;2531
"lambda[18]";1243.08832;63.4868746375393;1124;1200;1241;1285;1373
"lambda[19]";1234.79582;65.0899407323074;1116;1190;1232;1277;1370
"lambda[20]";849.037098;43.3442911360871;768.8;819.4;847.2;877.1;939.3
"lambda[21]";1359.12958;69.224235271461;1232;1311;1356;1404;1501
"lambda[22]";959.682862;52.6931265897247;862.7;923.4;957.3;993.5;1070
"lambda[23]";2160.32572;113.689866277498;1951;2081;2157;2235;2393
"lambda[24]";3387.96274;185.587263798845;3046;3259;3379;3508;3777
"lambda[25]";1415.27978;122.46956666473;1201;1329;1406;1492;1682
"lambda[26]";1805.75438;100.783745108431;1619;1736;1802;1872;2015
"lambda[27]";1365.6052;76.4567846940905;1227;1313;1362;1414;1525
"lambda[28]";1290.031818;101.618116915482;1102;1220;1286;1355;1500
"lambda[29]";1570.4584;114.487250714005;1364;1491;1564;1644;1813
"lambda[30]";2301.51296;127.309053346334;2070;2212;2296;2384;2565
"lambda[31]";1982.97002;261.44960883344;1543;1800.74994792872;1959;2137;2584
"Ntot[1]";752.23088;60.2958161577943;652;709;746;789;888
"Ntot[2]";367.48066;40.329474026993;308;338;361;389;466
"Ntot[3]";417.62238;37.9117144046188;356;391;413;440;504
"Ntot[4]";832.88052;78.7249472332369;706;777;823;878;1015
"Ntot[5]";823.40876;46.0403582691772;760;791;815;847;936
"Ntot[6]";203.22406;22.6044906241288;170;187;200;215;257.024952698949
"Ntot[7]";681.3986;44.2907587592065;614;650;675;705;787
"Ntot[8]";230.72326;16.4327488776867;210;219;227;238;273
"Ntot[9]";605.73408;134.398198589376;420;508;581;674;935
"Ntot[10]";748.8472;45.1438302702399;677;717;743;775;852
"Ntot[11]";1010.33084;67.7893915957848;901;963;1002;1049;1165
"Ntot[12]";478.58826;72.8435551977186;365;427;469;519;651
"Ntot[13]";1080.42926;119.380097453494;880;997;1068;1151;1347
"Ntot[14]";265.61382;22.416782446424;229;249;263;279;317
"Ntot[15]";2172.17252;57.5477050073818;2070;2132;2169;2208;2296
"Ntot[16]";1362.34808;97.3186774407317;1189;1295;1356;1422;1571
"Ntot[17]";2370.51824;62.6342236179372;2256;2327;2368;2411;2501
"Ntot[18]";1243.08912;52.7416925339738;1147;1206;1241;1277;1353
"Ntot[19]";1234.78708;54.5998077638901;1137;1197;1232;1270;1351
"Ntot[20]";848.21732;32.285699920336;791;826;846;868;918
"Ntot[21]";1359.14494;58.8654145924167;1253;1318;1356;1397;1483
"Ntot[22]";959.14506;42.773649473691;884;929;956;986;1051
"Ntot[23]";2162.30616;104.455414243234;1970;2090;2158;2230;2378
"Ntot[24]";3392.35804;176.564764745635;3068;3270;3384;3506;3761.02499676007
"Ntot[25]";1415.85676;116.792797780748;1213;1333;1406;1488;1673
"Ntot[26]";1807.02054;91.2579131815031;1640;1743;1803;1866;1999
"Ntot[27]";1366.11442;66.9173305403476;1247;1319;1362;1408;1507.02499191627
"Ntot[28]";1290.45038;95.1994302319396;1115.97498907285;1225;1286;1351;1487
"Ntot[29]";1571.32956;107.666262824942;1378;1496;1565;1639;1800
"Ntot[30]";2303.92114;117.671576062772;2093;2221;2298;2381;2548
"Ntot[31]";1984.46262;257.895897463713;1554;1804;1961;2135;2578
"Nesc[1]";751.23088;60.2958161577943;651;708;745;788;887
"Nesc[2]";361.48066;40.329474026993;302;332;355;383;460
"Nesc[3]";417.62238;37.9117144046188;356;391;413;440;504
"Nesc[4]";830.88052;78.7249472332369;704;775;821;876;1013
"Nesc[5]";817.40876;46.0403582691772;754;785;809;841;930
"Nesc[6]";203.22406;22.6044906241288;170;187;200;215;257.024952698949
"Nesc[7]";681.3986;44.2907587592065;614;650;675;705;787
"Nesc[8]";230.72326;16.4327488776867;210;219;227;238;273
"Nesc[9]";592.73408;134.398198589376;407;495;568;661;922
"Nesc[10]";747.8472;45.1438302702399;676;716;742;774;851
"Nesc[11]";1003.33084;67.7893915957848;894;956;995;1042;1158
"Nesc[12]";473.58826;72.8435551977186;360;422;464;514;646
"Nesc[13]";1079.42926;119.380097453494;879;996;1067;1150;1346
"Nesc[14]";263.61382;22.416782446424;227;247;261;277;315
"Nesc[15]";2168.17252;57.5477050073818;2066;2128;2165;2204;2292
"Nesc[16]";1362.34808;97.3186774407317;1189;1295;1356;1422;1571
"Nesc[17]";2369.51824;62.6342236179372;2255;2326;2367;2410;2500
"Nesc[18]";1234.08912;52.7416925339738;1138;1197;1232;1268;1344
"Nesc[19]";1233.78708;54.5998077638901;1136;1196;1231;1269;1350
"Nesc[20]";847.21732;32.285699920336;790;825;845;867;917
"Nesc[21]";1359.14494;58.8654145924167;1253;1318;1356;1397;1483
"Nesc[22]";958.14506;42.773649473691;883;928;955;985;1050
"Nesc[23]";2158.30616;104.455414243234;1966;2086;2154;2226;2374
"Nesc[24]";3392.35804;176.564764745635;3068;3270;3384;3506;3761.02499676007
"Nesc[25]";1415.85676;116.792797780748;1213;1333;1406;1488;1673
"Nesc[26]";1806.02054;91.2579131815031;1639;1742;1802;1865;1998
"Nesc[27]";1366.11442;66.9173305403476;1247;1319;1362;1408;1507.02499191627
"Nesc[28]";1290.45038;95.1994302319396;1115.97498907285;1225;1286;1351;1487
"Nesc[29]";1571.32956;107.666262824942;1378;1496;1565;1639;1800
"Nesc[30]";2303.92114;117.671576062772;2093;2221;2298;2381;2548
"Nesc[31]";1983.46262;257.895897463713;1553;1803;1960;2134;2577
"overdisp_MC[1]";1.121081822;0.288861013624657;0.6416;0.914574998974896;1.093;1.296;1.77
"overdisp_MC[2]";1.121081822;0.288861013624657;0.6416;0.914574998974896;1.093;1.296;1.77
"overdisp_MC[3]";3.363247368;0.866581626908045;1.925;2.744;3.278;3.888;5.30902499770466
"overdisp_MC[4]";4.48433084;1.155446592518;2.56697499525102;3.658;4.37;5.183;7.079
"overdisp_MC[5]";2.242167498;0.577724569976208;1.283;1.829;2.185;2.592;3.53902499655687
"overdisp_MC[6]";2.242167498;0.577724569976208;1.283;1.829;2.185;2.592;3.53902499655687
"overdisp_MC[7]";2.242167498;0.577724569976208;1.283;1.829;2.185;2.592;3.53902499655687
"overdisp_MC[8]";1.121081822;0.288861013624657;0.6416;0.914574998974896;1.093;1.296;1.77
"overdisp_MC[9]";2.242167498;0.577724569976208;1.283;1.829;2.185;2.592;3.53902499655687
"overdisp_MC[10]";3.363247368;0.866581626908045;1.925;2.744;3.278;3.888;5.30902499770466
"overdisp_MC[11]";3.363247368;0.866581626908045;1.925;2.744;3.278;3.888;5.30902499770466
"overdisp_MC[12]";13.45298702;3.46634268505636;7.69997499841707;10.97;13.11;15.55;21.24
"overdisp_MC[13]";5.60541286;1.4443034261866;3.208;4.573;5.463;6.479;8.849
"overdisp_MC[14]";6.72649782;1.73317562089648;3.85;5.487;6.556;7.775;10.62
"overdisp_MC[15]";13.45298702;3.46634268505636;7.69997499841707;10.97;13.11;15.55;21.24
"overdisp_MC[16]";13.45298702;3.46634268505636;7.69997499841707;10.97;13.11;15.55;21.24
"overdisp_MC[17]";23.54273538;6.06608195630114;13.47;19.21;22.94;27.21;37.1602499672085
"overdisp_MC[18]";24.66383326;6.35494905726617;14.12;20.12;24.04;28.51;38.9302499686991
"overdisp_MC[19]";23.54273538;6.06608195630114;13.47;19.21;22.94;27.21;37.1602499672085
"overdisp_MC[20]";14.57407992;3.75520341052597;8.341;11.89;14.2;16.85;23.01
"overdisp_MC[21]";20.17950766;5.19951407037164;11.55;16.46;19.67;23.33;31.8502499617426
"overdisp_MC[22]";12.33190754;3.17746533266218;7.058;10.06;12.02;14.25;19.47
"overdisp_MC[23]";19.0583958;4.91067244252547;10.91;15.55;18.57;22.03;30.09
"overdisp_MC[24]";17.93729706;4.62179203084765;10.27;14.63;17.48;20.73;28.32
"overdisp_MC[25]";7.84756688;2.02201096262452;4.491;6.402;7.648;9.071;12.39
"overdisp_MC[26]";12.33190754;3.17746533266218;7.058;10.06;12.02;14.25;19.47
"overdisp_MC[27]";8.96866558;2.31089824748678;5.133;7.31674998718635;8.741;10.37;14.16
"overdisp_MC[28]";13.45298702;3.46634268505636;7.69997499841707;10.97;13.11;15.55;21.24
"overdisp_MC[29]";14.57407992;3.75520341052597;8.341;11.89;14.2;16.85;23.01
"overdisp_MC[30]";20.17950766;5.19951407037164;11.55;16.46;19.67;23.33;31.8502499617426
"overdisp_MC[31]";12.33190754;3.17746533266218;7.058;10.06;12.02;14.25;19.47
"mean_MC[1]";0.614433304;0.0283456793038073;0.557197499781247;0.5959;0.6148;0.6335;0.668802499817789
"mean_MC[2]";0.62300511;0.0276506953855958;0.5669;0.605;0.6235;0.6417;0.676
"mean_MC[3]";0.618433822;0.027467993062566;0.5626;0.6005;0.6189;0.637;0.671
"mean_MC[4]";0.618941878;0.0274248312166267;0.563397499783654;0.6011;0.6195;0.6374;0.6714
"mean_MC[5]";0.64934965;0.0472322311769277;0.5524;0.6184;0.6509;0.6816;0.7381
"mean_MC[6]";0.642743724;0.040420722731148;0.5604;0.6163;0.6439;0.6701;0.7193
"mean_MC[7]";0.644073944;0.0417308791521382;0.5589;0.6167;0.645349998063066;0.6724;0.723002499831447
"mean_MC[8]";0.640729192;0.0385050159297743;0.5623;0.6157;0.6418;0.6668;0.7138
"mean_MC[9]";0.596921356;0.0404764099385864;0.5149;0.5705;0.5976;0.6239;0.6747
"mean_MC[10]";0.616058498;0.0278766898246673;0.5595;0.5978;0.6164;0.6348;0.6696
"mean_MC[11]";0.653423216;0.0517426916108937;0.547;0.6196;0.655349998092622;0.6889;0.75
"mean_MC[12]";0.65707002;0.0559304585062859;0.5413;0.6207;0.6595;0.6957;0.7605
"mean_MC[13]";0.623598148;0.0277678279383798;0.56739749978518;0.6055;0.6241;0.642424998540761;0.6769
"mean_MC[14]";0.608658366;0.0311155332581372;0.5459;0.5884;0.6092;0.6296;0.6685
"mean_MC[15]";0.591655552;0.0456248387448493;0.499197499755827;0.5617;0.5924;0.622;0.6795
"mean_MC[16]";0.558876904;0.0818727090927414;0.3945;0.5046;0.5602;0.6138;0.7166
"mean_MC[17]";0.619015694;0.0274199200972345;0.563497499783693;0.601174998440467;0.6195;0.6375;0.6715
"mean_MC[18]";0.622546506;0.0275742873383594;0.5667;0.6046;0.6231;0.6412;0.6753
"mean_MC[19]";0.645641978;0.0433191478103951;0.5571;0.6172;0.647;0.675;0.7274
"mean_MC[20]";0.629278778;0.0299050300190975;0.5686;0.6098;0.6299;0.6494;0.6863
"mean_MC[21]";0.6147793;0.0282333062233527;0.5576;0.5963;0.6152;0.6338;0.669
"mean_MC[22]";0.615973208;0.0278974810615175;0.5594;0.5977;0.6164;0.6348;0.6696
"mean_MC[23]";0.607241782;0.0320214677045315;0.542697499775401;0.5864;0.6077;0.6287;0.6685
"mean_MC[24]";0.632284158;0.0316938844712555;0.568;0.6116;0.633;0.6536;0.6928
"mean_MC[25]";0.63335753;0.032425722965715;0.5674;0.6122;0.6341;0.6551;0.6955
"mean_MC[26]";0.654145706;0.0525623177067604;0.5459;0.6198;0.6563;0.6902;0.7521
"mean_MC[27]";0.634660544;0.0333735867288772;0.5668;0.6128;0.6354;0.6572;0.6985
"mean_MC[28]";0.602129702;0.0358626609804717;0.529397499769758;0.5786;0.6027;0.626;0.6708
"mean_MC[29]";0.615824544;0.0279350901444275;0.5592;0.5975;0.6162;0.6346;0.669402499817952
"mean_MC[30]";0.6058289;0.032999225405569;0.539;0.5843;0.6063;0.628;0.6689
"mean_MC[31]";0.590925374;0.046367583825521;0.497;0.5605;0.5917;0.6218;0.680202499820842
"p_MC[1]";0.679730784;0.0500227538292661;0.578;0.6464;0.681;0.7144;0.7735
"p_MC[2]";0.757096724;0.0746442164862685;0.5972;0.7089;0.7618;0.8113;0.8878
"p_MC[3]";0.714943878;0.0581901530776421;0.595;0.6762;0.7176;0.7556;0.8225
"p_MC[4]";0.65503067;0.056941952678764;0.5367;0.6178;0.6569;0.6944;0.7607024998398
"p_MC[5]";0.903774468;0.0465651784881571;0.7956;0.877;0.9105;0.9377;0.9742
"p_MC[6]";0.748170416;0.0711593840722766;0.5948;0.7028;0.7529;0.799;0.8728
"p_MC[7]";0.845929888;0.0506258872348586;0.7327;0.8151;0.8507;0.882;0.9313
"p_MC[8]";0.906146084;0.0560240774364915;0.7694;0.8755;0.9157;0.9478;0.9842
"p_MC[9]";0.563841012;0.110582231014807;0.3528;0.4861;0.5636;0.643524998543256;0.774502499842654
"p_MC[10]";0.828118378;0.0463012221621912;0.7282;0.7988;0.8316;0.8613;0.9091
"p_MC[11]";0.759176812;0.0473302255701545;0.6591;0.729;0.762;0.792;0.8439
"p_MC[12]";0.431568586;0.0574970593299974;0.3175;0.392774997612935;0.4315;0.470724998008532;0.5439
"p_MC[13]";0.486644232;0.050022413356084;0.389097499686724;0.453;0.4868;0.5197;0.5862
"p_MC[14]";0.74002652;0.0537540754762112;0.6291;0.705;0.7422;0.778;0.8378
"p_MC[15]";0.84611876;0.0209127412195844;0.8026;0.8325;0.8469;0.8607;0.8846
"p_MC[16]";0.501872796;0.0326588756877148;0.4379;0.48;0.5018;0.5236;0.566702499784964
"p_MC[17]";0.788292146;0.0189940956728161;0.7499;0.7759;0.7887;0.8012;0.8245
"p_MC[18]";0.67669553;0.0252190151075247;0.6265;0.6597;0.677;0.6937;0.7253
"p_MC[19]";0.687883734;0.0270900296974999;0.6336;0.6698;0.6884;0.7065;0.7397
"p_MC[20]";0.776727156;0.0255664788238125;0.7244;0.76;0.7774;0.7943;0.8247
"p_MC[21]";0.653572842;0.0250268358825746;0.6036;0.6368;0.6542;0.6707;0.7015
"p_MC[22]";0.759543236;0.0305813940931671;0.6972;0.7392;0.7603;0.7808;0.8169
"p_MC[23]";0.575157596;0.0256544811241393;0.5253;0.5579;0.5751;0.5924;0.6255
"p_MC[24]";0.539554258;0.0265556681772401;0.4877;0.5216;0.5396;0.5574;0.5919
"p_MC[25]";0.487216482;0.0372603329774701;0.414;0.46227499797184;0.4873;0.5124;0.5602
"p_MC[26]";0.55372792;0.0251654942513677;0.5043;0.5366;0.5538;0.5709;0.6026
"p_MC[27]";0.712937864;0.0323060890605055;0.6489;0.6915;0.7134;0.7349;0.7748
"p_MC[28]";0.445077036;0.0295199791402039;0.3886;0.4249;0.4447;0.4647;0.5043
"p_MC[29]";0.471841452;0.0294892163003573;0.4146;0.4519;0.4717;0.4919;0.53
"p_MC[30]";0.542414668;0.0255185606410025;0.4927;0.5249;0.5425;0.5599;0.5916
"p_MC[31]";0.259249768;0.0313277365362981;0.1992;0.2382;0.2584;0.2797;0.3228
"alpha_MC[1]";0.68978762;0.183938112770905;0.3829;0.5579;0.6714;0.8021;1.104
"alpha_MC[2]";0.699575634;0.186976694800678;0.388597499686321;0.5655;0.6804;0.813924998848221;1.121
"alpha_MC[3]";2.083062526;0.555754637457791;1.156;1.684;2.027;2.422;3.33202499634301
"alpha_MC[4]";2.779737758;0.74172808449752;1.543;2.247;2.705;3.233;4.44802499726041
"alpha_MC[5]";1.459429654;0.402646802737331;0.792897499846279;1.171;1.42;1.704;2.36102499483943
"alpha_MC[6]";1.444295964;0.394093039601803;0.79269749984624;1.162;1.406;1.683;2.327
"alpha_MC[7]";1.447339004;0.395743172866779;0.79279749984626;1.164;1.408;1.687;2.333
"alpha_MC[8]";0.719840872;0.1958291435138;0.3955;0.5793;0.7006;0.8386;1.159
"alpha_MC[9]";1.339614994;0.360678101319772;0.7382;1.081;1.305;1.558;2.149
"alpha_MC[10]";2.074925936;0.553346685455701;1.152;1.677;2.02;2.412;3.31802499632758
"alpha_MC[11]";2.20315269;0.612522398464037;1.189;1.765;2.143;2.575;3.57702499659344
"alpha_MC[12]";8.86282224;2.48233865513659;4.7509749974344;7.086;8.62;10.37;14.44
"alpha_MC[13]";3.50126382;0.936086052455093;1.94297499372536;2.83;3.405;4.073;5.61
"alpha_MC[14]";4.09917256;1.09416664271759;2.277;3.316;3.991;4.767;6.564
"alpha_MC[15]";7.96560958;2.15933267273574;4.364;6.416;7.75949998389072;9.274;12.79
"alpha_MC[16]";7.51697518;2.21042203568357;3.818;5.938;7.307;8.863;12.41
"alpha_MC[17]";14.59541864;3.8946413962588;8.103;11.8;14.2;16.97;23.36
"alpha_MC[18]";15.37913338;4.10941493047504;8.54;12.43;14.96;17.89;24.64
"alpha_MC[19]";15.23478318;4.17625435447337;8.327;12.24;14.83;17.77;24.57
"alpha_MC[20]";9.18766004;2.46637177529704;5.09597499760811;7.419;8.94249998602181;10.69;14.74
"alpha_MC[21]";12.42326708;3.31276574832667;6.89697499823276;10.05;12.09;14.45;19.88
"alpha_MC[22]";7.60699462;2.02863730349642;4.22297499711357;6.14974998475465;7.405;8.845;12.17
"alpha_MC[23]";11.58684686;3.09454968611644;6.43297499810528;9.373;11.29;13.48;18.5402499342871
"alpha_MC[24]";11.36288568;3.05902958228433;6.288;9.167;11.06;13.23;18.25
"alpha_MC[25]";4.97984966;1.3421632773188;2.75497499557517;4.017;4.846;5.796;8.002
"alpha_MC[26]";8.08734768;2.25167215275854;4.35897499720364;6.475;7.868;9.457;13.14
"alpha_MC[27]";5.70317564;1.53934603119463;3.15097499613137;4.6;5.55;6.63724998587588;9.167
"alpha_MC[28]";8.10895566;2.17248079046735;4.49;6.552;7.898;9.43;12.9902499062254
"alpha_MC[29]";8.98789178;2.39687996137049;4.99;7.265;8.749;10.45;14.37
"alpha_MC[30]";12.23941714;3.27110996031342;6.787;9.896;11.92;14.23;19.58
"alpha_MC[31]";7.29264842;1.97905959063106;3.995;5.872;7.105;8.492;11.72
"beta_MC[1]";0.431295298;0.111864626723489;0.2456;0.3511;0.4202;0.499;0.6812
"beta_MC[2]";0.421507;0.108546867368194;0.241897499496039;0.3435;0.4108;0.4873;0.663
"beta_MC[3]";1.280182638;0.330457772653559;0.7332;1.043;1.248;1.48;2.017
"beta_MC[4]";1.70459326;0.439823595879169;0.977;1.389;1.661;1.97;2.684
"beta_MC[5]";0.782737032;0.214547598476588;0.424897499713123;0.629;0.7615;0.9138;1.256
"beta_MC[6]";0.797870622;0.212537632924716;0.444397499725713;0.6455;0.7764;0.928;1.27
"beta_MC[7]";0.794824636;0.212798485970601;0.440797499723473;0.6425;0.7738;0.9245;1.266
"beta_MC[8]";0.401241978;0.106140318040742;0.2253;0.3251;0.3905;0.4661;0.6365
"beta_MC[9]";0.902552398;0.244633460104798;0.495997499754252;0.7271;0.8788;1.051;1.449
"beta_MC[10]";1.28831749;0.33340766610163;0.735294999336887;1.049;1.255;1.49;2.031
"beta_MC[11]";1.160095902;0.324998884765022;0.6179;0.927074998988719;1.128;1.358;1.87902499351611
"beta_MC[12]";4.59017644;1.31470689670109;2.396;3.649;4.46;5.391;7.49602499837428
"beta_MC[13]";2.104148092;0.541834095531189;1.208;1.715;2.051;2.433;3.309
"beta_MC[14]";2.627319642;0.688838889341696;1.483;2.132;2.56;3.045;4.173
"beta_MC[15]";5.4873846;1.51520878188977;2.96997499589556;4.399;5.341;6.407;8.869
"beta_MC[16]";5.936011278;1.87813157875947;2.80397499565251;4.586;5.76;7.082;10.13
"beta_MC[17]";8.94734082;2.30849083978708;5.12997499762396;7.292;8.718;10.34;14.09
"beta_MC[18]";9.2846822;2.39120024955164;5.33;7.568;9.047;10.73;14.6002499165616
"beta_MC[19]";8.30795484;2.23861556265325;4.58297499734033;6.70674998602085;8.084;9.669;13.26
"beta_MC[20]";5.38640324;1.39076313609454;3.083;4.39;5.251;6.23424998496291;8.471
"beta_MC[21]";7.75621004;2.01069772480848;4.419;6.312;7.557;8.972;12.25
"beta_MC[22]";4.72491346;1.22290490270456;2.696;3.847;4.604;5.464;7.45002499836424
"beta_MC[23]";7.47155334;1.96533961515838;4.20997499710465;6.058;7.279;8.66124998917634;11.88
"beta_MC[24]";6.5744419;1.70405974578849;3.757;5.352;6.41;7.61;10.35
"beta_MC[25]";2.867726738;0.74464291572694;1.635;2.334;2.795;3.322;4.52
"beta_MC[26]";4.24456126;1.19410087179645;2.25297499458896;3.387;4.125;4.972;6.889
"beta_MC[27]";3.265484744;0.850042161850101;1.8579749934382;2.656;3.182;3.782;5.15102499763426
"beta_MC[28]";5.34402452;1.42498597488514;2.98;4.322;5.209;6.207;8.531
"beta_MC[29]";5.58619406;1.4460936187591;3.187;4.5477499793839;5.44349997703683;6.46024998548893;8.80902499861657
"beta_MC[30]";7.94007824;2.09589751224771;4.463;6.432;7.737;9.206;12.64
"beta_MC[31]";5.03926324;1.39523798638278;2.72097499551986;4.036;4.906;5.885;8.155
"test[1]";0.63174;0.482337252743874;0;0;1;1;1
"test[2]";0.21714;0.412302825933082;0;0;0;0;1
......@@ -12,15 +12,14 @@ library(mcmcplots)
##-----------------------------INFO ----------------------------------##
# year <- "2016"
# site <- "Oir"
# stade <- "tacon"
year <- "2016"
site <- "Oir"
stade <- "tacon"
## WORKING DIRECTORY:
# work.dir<-paste("/media/ORE/Abundance",site,stade,sep="/")
# setwd(work.dir)
work.dir<-paste("/home/basp-meco88/Documents/RESEARCH/PROJECTS/ORE/Abundance",site,stade,sep="/")
setwd(work.dir)
##-----------------------------DATA ----------------------------------##
......@@ -45,18 +44,19 @@ inits <- list(read.bugsdata(paste("inits/init-",site,"-",stade,year,".txt",sep="
#------------------------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
if(site == "Scorff" && stade == "smolt") {model <- paste("model/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=1000 # Total number of steps in chains to save.
nthin=1 # Number of steps to "thin" (1=keep every step).
nburnin=5000 # Number of steps to "burn-in" the samplers.
nstore=25000 # Total number of steps in chains to save.
nthin=2 # Number of steps to "thin" (1=keep every step).
#nPerChain = ceiling( ( numSavedSteps * thinSteps ) / nChains ) # Steps per chain.
### Start of the run ###
......@@ -78,11 +78,38 @@ fit <- bugs(
## cleaning
system("rm bugs/CODA*")
### Save inits ###
# save last values for inits
#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=""))
# inits <- fit$last.values
# if(site == "Nivelle") {
# save(inits,file=paste('inits/inits_',stade,year,'.Rdata',sep=""))
# }
######### JAGS ##########
## Compile & adapt
#Create, initialize, and adapt the model:
# fit <- jags.model(
# model,
# data,inits,
# n.chains=nChains,
# n.adapt = adaptSteps)
# # Run JAGS in parallel. Each Chain is sent to a seperate core.
# cl <- makeSOCKcluster(nChains) # Request 3 cores. /!\ Need to check how many core your computer has
# fit.mcmc <- jags.parfit(cl,
# data,
# parameters,
# model.dir,
# inits,
# n.chains=nChains,n.adapt=adaptSteps,n.update=nburnin,n.iter=nstore*nthin, thin=nthin
# )
# stopCluster(cl) #### /!\ Really important to do!
# duration of the run
end.time = Sys.time()
elapsed.time = difftime(end.time, start.time, units='mins')
cat("Sample analyzed after ", elapsed.time, ' minutes\n')
## BACKUP
......@@ -151,6 +178,6 @@ dev.off()
#------------------------------------------------------------------------------
## SUMMARY
if(site == "Scorff" && stade == "adult") {source("summary_adult.R")}
#if(site == "Scorff" && stade == "adult") {source("summary_adult.R")}
if(site == "Nivelle" && stade == "tacon") {source("analyse_coda_tacon.R")}
OpenBUGS did not run correctly.
......@@ -4,7 +4,32 @@ data loaded
model compiled
model is initialized
model is already initialized
500 updates took 14 s
5000 updates took 295 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
......@@ -30,31 +55,3 @@ 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