Commit ed78a0b8 authored by Thomas Brand's avatar Thomas Brand

New optimized mode with hh positive-definite.

parent 91ca605e
sources/*
modules/matlab.inc
matlab.mk
*~
*.mat
*.pdf
*.log
*.eps
*.dat
*.RData
*.Rhistory
*.out
*.png
*synctex.gz
tex/auto
mod/*/*tex
*aux
*.c
*.mexa64
mars_steadystate2.m
mars_steadystate_source.m
......@@ -382,7 +382,11 @@ dataFR_forecast <-
spread(var,value) %>%
arrange(period)
write_csv(dataFR_forecast,"dataFR_forecast.csv")
dataFR_forecast2 <-
dataFR_forecast %>%
mutate(period=gsub(" ", "", as.yearqtr(period)))
write_csv(dataFR_forecast2,"dataFR_forecast.csv")
```
......
omega,0.246339 ;
iota,0.047163 ;
epsk,0.628839 ;
epsg,0.831057 ;
h,0.788468 ;
thetaw,0.853738 ;
thetap,0.928212 ;
thetax,0.704786 ;
thetam,0.795109 ;
chiw,0.777601 ;
chip,0.816131 ;
chix,0.485509 ;
chim,0.829567 ;
omegam,0.231603 ;
epsc,1.620552 ;
epsi,1.207665 ;
epsw,1.608774 ;
kappa,4.634848 ;
gammac,0.607623 ;
gammai,0.041558 ;
gammapi,1.836762 ;
gammay,0.914571 ;
FBAR,0.045172 ;
rhotauc,0.924168 ;
rhotaun,0.945049 ;
rhotauwh,0.970619 ;
rhotauwf,0.969713 ;
rhoyw,0.968192 ;
rhopoil,0.946596 ;
rhotauls,0.446402 ;
rhoa,0.831245 ;
rhoxia,0.989395 ;
rhomu,0.819468 ;
rhozetai,0.783780 ;
rhoeps,0.707782 ;
rhoepsw,0.887191 ;
rhor,0.904407 ;
rhod,0.998200 ;
rhoxib,0.507697 ;
rhosigma,0.977330 ;
rhogc,0.913500 ;
rhogi,0.950399 ;
rhot,0.898601 ;
rhoothgov,0.831812 ;
rhogovy,0.272846 ;
rhogovb,0.013973 ;
sigtauc,0.013128 ;
sigtaun,0.023948 ;
sigtauwh,0.007276 ;
sigtauwf,0.004677 ;
sigtauls,0.193894 ;
siga,0.002410 ;
sigxia,0.005777 ;
sigmu,0.003818 ;
sigzetai,0.005226 ;
sigeps,0.983089 ;
sigepsw,0.981257 ;
sigr,0.000759 ;
sigd,0.927816 ;
sigxib,0.043823 ;
siggc,0.001726 ;
siggi,0.013644 ;
sigt,0.006027 ;
sigothgov,0.027809 ;
siggamman,0.009592 ;
sigsigma,0.033674 ;
sigyw,0.015314 ;
sigpoil,0.150805 ;
omega,0.686049 ;
iota,0.498892 ;
epsk,0.811827 ;
epsg,0.172664 ;
h,0.568159 ;
thetaw,0.774568 ;
thetap,0.787178 ;
thetax,0.519596 ;
thetam,0.705313 ;
chiw,0.533563 ;
chip,0.571717 ;
chix,0.320729 ;
chim,0.767567 ;
omegam,0.149674 ;
epsc,1.248917 ;
epsi,1.370181 ;
epsw,1.769773 ;
kappa,5.009242 ;
gammac,1.110787 ;
gammai,1.697801 ;
gammapi,1.732484 ;
gammay,0.895491 ;
FBAR,0.009991 ;
rhotauc,0.926178 ;
rhotaun,0.918729 ;
rhotauwh,0.966294 ;
rhotauwf,0.967888 ;
rhoyw,0.942149 ;
rhopoil,0.927868 ;
rhotauls,0.625948 ;
rhoa,0.861692 ;
rhoxia,0.987510 ;
rhomu,0.826122 ;
rhozetai,0.801920 ;
rhoeps,0.989798 ;
rhoepsw,0.686855 ;
rhor,0.906523 ;
rhod,0.559434 ;
rhoxib,0.918113 ;
rhosigma,0.960773 ;
rhogc,0.937163 ;
rhogi,0.961622 ;
rhot,0.898516 ;
rhoothgov,0.823865 ;
rhogovy,0.154495 ;
rhogovb,0.011807 ;
sigtauc,0.010030 ;
sigtaun,0.019346 ;
sigtauwh,0.007444 ;
sigtauwf,0.005154 ;
sigtauls,0.182054 ;
siga,0.002015 ;
sigxia,0.005539 ;
sigmu,0.004322 ;
sigzetai,0.003941 ;
sigeps,0.060636 ;
sigepsw,0.564712 ;
sigr,0.000681 ;
sigd,0.030151 ;
sigxib,0.002814 ;
siggc,0.001744 ;
siggi,0.012175 ;
sigt,0.004870 ;
sigothgov,0.021008 ;
siggamman,0.007366 ;
sigsigma,0.035105 ;
sigyw,0.017308 ;
sigpoil,0.154146 ;
// Load data in levels.
dataFRlevels = dseries('../../data/dataFR.csv');
dataFRlevels = dseries('../../data/dataFR_forecast.csv');
// Remove the first observations (same starting date as in CMR) and rename the dseries object.
dataFR=dataFRlevels(1995Q1:dataFRlevels.dates(end));
......
omega = 0.246339;
iota = 0.047163;
epsk = 0.628839;
epsg = 0.831057;
h = 0.788468;
thetaw = 0.853738;
thetap = 0.928212;
thetax = 0.704786;
thetam = 0.795109;
chiw = 0.777601;
chip = 0.816131;
chix = 0.485509;
chim = 0.829567;
omegam = 0.231603;
epsc = 1.620552;
epsi = 1.207665;
epsw = 1.608774;
kappa = 4.634848;
gammac = 0.607623;
gammai = 0.041558;
gammapi = 1.836762;
gammay = 0.914571;
FBAR = 0.045172;
rhotauc = 0.924168;
rhotaun = 0.945049;
rhotauwh = 0.970619;
rhotauwf = 0.969713;
rhoyw = 0.968192;
rhopoil = 0.946596;
rhotauls = 0.446402;
rhoa = 0.831245;
rhoxia = 0.989395;
rhomu = 0.819468;
rhozetai = 0.783780;
rhoeps = 0.707782;
rhoepsw = 0.887191;
rhor = 0.904407;
rhod = 0.998200;
rhoxib = 0.507697;
rhosigma = 0.977330;
rhogc = 0.913500;
rhogi = 0.950399;
rhot = 0.898601;
rhoothgov = 0.831812;
rhogovy = 0.272846;
rhogovb = 0.013973;
sigtauc = 0.013128;
sigtaun = 0.023948;
sigtauwh = 0.007276;
sigtauwf = 0.004677;
sigtauls = 0.193894;
siga = 0.002410;
sigxia = 0.005777;
sigmu = 0.003818;
sigzetai = 0.005226;
sigeps = 0.983089;
sigepsw = 0.981257;
sigr = 0.000759;
sigd = 0.927816;
sigxib = 0.043823;
siggc = 0.001726;
siggi = 0.013644;
sigt = 0.006027;
sigothgov = 0.027809;
siggamman = 0.009592;
sigsigma = 0.033674;
sigyw = 0.015314;
sigpoil = 0.150805;
omega = 0.686049;
iota = 0.498892;
epsk = 0.811827;
epsg = 0.172664;
h = 0.568159;
thetaw = 0.774568;
thetap = 0.787178;
thetax = 0.519596;
thetam = 0.705313;
chiw = 0.533563;
chip = 0.571717;
chix = 0.320729;
chim = 0.767567;
omegam = 0.149674;
epsc = 1.248917;
epsi = 1.370181;
epsw = 1.769773;
kappa = 5.009242;
gammac = 1.110787;
gammai = 1.697801;
gammapi = 1.732484;
gammay = 0.895491;
FBAR = 0.009991;
rhotauc = 0.926178;
rhotaun = 0.918729;
rhotauwh = 0.966294;
rhotauwf = 0.967888;
rhoyw = 0.942149;
rhopoil = 0.927868;
rhotauls = 0.625948;
rhoa = 0.861692;
rhoxia = 0.987510;
rhomu = 0.826122;
rhozetai = 0.801920;
rhoeps = 0.989798;
rhoepsw = 0.686855;
rhor = 0.906523;
rhod = 0.559434;
rhoxib = 0.918113;
rhosigma = 0.960773;
rhogc = 0.937163;
rhogi = 0.961622;
rhot = 0.898516;
rhoothgov = 0.823865;
rhogovy = 0.154495;
rhogovb = 0.011807;
sigtauc = 0.010030;
sigtaun = 0.019346;
sigtauwh = 0.007444;
sigtauwf = 0.005154;
sigtauls = 0.182054;
siga = 0.002015;
sigxia = 0.005539;
sigmu = 0.004322;
sigzetai = 0.003941;
sigeps = 0.060636;
sigepsw = 0.564712;
sigr = 0.000681;
sigd = 0.030151;
sigxib = 0.002814;
siggc = 0.001744;
siggi = 0.012175;
sigt = 0.004870;
sigothgov = 0.021008;
siggamman = 0.007366;
sigsigma = 0.035105;
sigyw = 0.017308;
sigpoil = 0.154146;
addpath ~/works/mars/modules/dynare/matlab/
addpath ~/works/mars/tools/m/
generateparametercalibration mars_mode.mat values-for-estimated-parameters
generateparameterinitialization mars_mode.mat initial-values
......@@ -35,9 +35,7 @@ estimated_params_init;
@#include "initial-values.inc"
end;
estimation(presample=12, lyapunov=doubling, mode_compute=8, mh_replic=200, kalman_algo=2, consider_only_observed,mode_file=mars_mode,mode_check,forecast=40);
%smoother2histval(outfile='histval.mat');
estimation(presample=12, lyapunov=doubling, mode_compute=0, mh_replic=2000, kalman_algo=2, consider_only_observed,mode_file=mars_mode,mode_check,forecast=40);
rawdataset = struct(dataset_);
rawdatatime = struct(rawdataset.dates);
......
......@@ -208,19 +208,19 @@ if("posterior_mode" %in% row.names(oo_)){
}
dataPost <- data.frame(names=postnames,
unlist(subset(oo_,row.names(oo_)=="posterior_mode")[[1]])#,
#unlist(subset(oo_,row.names(oo_)=="posterior_mean")[[1]]),
#unlist(subset(oo_,row.names(oo_)=="posterior_hpdinf")[[1]]),
#unlist(subset(oo_,row.names(oo_)=="posterior_hpdsup")[[1]]),
#unlist(subset(oo_,row.names(oo_)=="posterior_std")[[1]])
unlist(subset(oo_,row.names(oo_)=="posterior_mode")[[1]]),
unlist(subset(oo_,row.names(oo_)=="posterior_mean")[[1]]),
unlist(subset(oo_,row.names(oo_)=="posterior_hpdinf")[[1]]),
unlist(subset(oo_,row.names(oo_)=="posterior_hpdsup")[[1]]),
unlist(subset(oo_,row.names(oo_)=="posterior_std")[[1]])
)
priorPost <- merge(dataPrior,dataPost,by="names")
colnames(priorPost) <- c('code','Prior density','Prior mean','Prior stdv',
"Post. mode")#,"Post. mean",
#"Prob. Interval 10%","Prob. Interval 90%",
#"Post. stdv")
"Post. mode","Post. mean",
"Prob. Interval 10%","Prob. Interval 90%",
"Post. stdv")
priorPost %<>%
merge(var_code_name,by="code") %>%
......
......@@ -17,9 +17,9 @@ dataPriorPost <- NULL
dataForecast <- NULL
scenario_df <-
data.frame(scenario_code=c("mars-FR"),
scenario_name=c("mars-FR"))
scenario <- "mars-FR"
data.frame(scenario_code=c("marsFR"),
scenario_name=c("marsFR"))
scenario <- "marsFR"
#for (scenario in listScenario){
......@@ -217,7 +217,7 @@ if(!is.null(dataIrfs)){
if(!is.null(dataPriorPost)){
dataPriorPost %<>%
gather(var2,values,2:5) %>%
gather(var2,values,2:9) %>%
unite(var_scenar,var2,scenario,sep=", ") %>%
spread(var_scenar,values) %>%
arrange(measure)
......
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