Warning: Stan seems to have exited badly.
> In StanFit/process_exit_failure (line 280)
In StanFit/process_exit (line 170)
In StanFit>@(src,evnt)process_exit(self,src,evnt)
In processState/set.exitValue (line 30)
In processManager.pollTimerStop (line 504)
In timer/timercb (line 30)
In timercb (line 13)
In timer/start (line 39)
In processManager/start (line 399)
In StanModel/sampling (line 747)
In stan (line 137) fit1 = stan( 'model_code',SV_code,'data',SV_data,'warmup',1000,'iter',10000,'chains',1,'init',inits)
inits=struct('H21',.64,'H31',-2.11,'H12',-2.36,'H32',-1.69,'H13',-2.69,'H23',-.27)
SV_code= {
'data {'
' int<lower=0> T; // # time points (equally spaced)'
'matrix[T,3] y; // observed shocks'
'}'
'transformed data {'
'vector[3] zeros; //means are zeros'
'vector[T] yzeros;'
'yzeros = rep_vector(0, T);'
'zeros = rep_vector(0, 3);'
'}'
'parameters {'
'corr_matrix[3] Omega;'
'vector<lower=-1,upper=1>[3] phi;'
'vector<lower=0>[3] sigma; '
' matrix[T,3] h_innov; // std log volatility time t'
'real H21;'
' real H31;'
' real H12;'
' real H32;'
' real H13;'
' real H23;'
'}'
'transformed parameters {'
' matrix[T,3] h; // log volatility at time t'
'matrix[3,3] H;'
'cov_matrix[3] Sigma; '
'Sigma = quad_form_diag(Omega, sigma); '
'H[1, 1] = 1; H[1, 2] = H12; H[1, 3] = H13; '
'H[2, 1] = H21; H[2, 2] = 1; H[2, 3] = H23;'
'H[3, 1] = H31; H[3, 2] = H32; H[3, 3] = 1; '
' h = h_innov;'
' h[1,1] = h[1,1] ./ sqrt(1 - phi[1] * phi[1]);'
' h[1,2] = h[1,2] ./ sqrt(1 - phi[2] * phi[2]);'
' h[1,3] = h[1,3] ./ sqrt(1 - phi[3] * phi[3]);'
' for (t in 2:T)'
' h[t] = h[t] + h[t-1] * diag_matrix(phi);'
'}'
'model {'
'vector[3] vol_t;'
'Omega ~ lkj_corr(1); // LKJ prior on the correlation matrix ;'
'sigma ~ cauchy(0, 2);'
'for (t in 1:T){'
'h_innov[t] ~ multi_normal(zeros,Sigma);'
'vol_t=h[t]'' ;'
'y[t] ~ multi_normal(zeros, H*diag_matrix(exp(vol_t))*H'');'
'}'
'phi ~ uniform(-1,1);'
'H21 ~ normal(0,1);'
'H31 ~ normal(0,1);'
'H12 ~ normal(0,1);'
'H32 ~ normal(0,1);'
'H13 ~ normal(0,1);'
'H23 ~ normal(0,1);'
'}'
};