Partial information in Dynare 4.20

Dear all,

I tried to run the partial information option on a relatively simple model. I might not have specifed the mod-file correctly but still I think that there is a bug in the error handling that starts in the function “PI_gensys”.

The try-catch block in that function reports an error (“Operands to the || and && operators must be convertible to logical scalar values.”) which is why Matlab steps out of “PI_gensys” at line 105 without assigning the output arguments. Next the function “dr1_PI” sets “options_.partial_information = 0” but still “info=0”. Hence, “PCL_resol” does not abort in line 134 and instead “stoch_simul” crashes in line 132 because the varianle PCL_varobs has not been assigned.

The model solves fine under full informatio without using the partial info option, but specifiying full information as

varobs PIE, X, Y, Yf, MC, R, G, A, Rf, U;
stoch_simul(partial_information,irf=16) R PIE MC Y;

als lead to a crash.

I enclose the code below.

Thanks in advance.


[code]// example 1 Gali’s model

var PIE, X, Y, Yf, MC, R, G, A, Rf, U;
varexo epsG, epsA, epsR,epsU;

parameters beta, sigma, phi, fx, fpi, fr, rhoa, rhog, rhou, theta;

beta = 0.99;
theta = 0.75;
sigma = 1.50;
phi = 2.00;
fx = 0.50;
fpi = 1.50;
fr = 0.80;
rhog = 0.80;
rhoa = 0.85;
rhou = 0.00;

// Parameter definitions

psia = (1+phi)/(sigma+phi);

psig = sigma/(sigma+phi);

lambda = (1-betatheta)(1-theta)/theta;

// Model equations
PIE = beta * PIE(+1) + lambdaMC+U;
Y = Y(+1) - 1/sigma
R = frR(-1) + (1-fr)(fpiPIE + fxX) + epsR;
MC = (sigma+phi)*Y - (1+phi)A - sigmaG;

// Output gap
X = Y - Yf;

// flex price model
Rf = sigmapsia(rhoa-1)A - sigma(1-psig)*(rhog-1)G;
Yf = psia
A + psig * G;

A = rhoaA(-1) + epsA;
G = rhog
G(-1) + epsG;
U = rhou*U(-1) + epsU;

var epsG;
stderr 1;
var epsR;
stderr 1;
var epsA;
stderr 1;
var epsU;
stderr 1;


//stoch_simul(linear,irf=16,simul) R PIE MC X Y Yf Rf A G;
//stoch_simul(linear,irf=16,simul) R PIE MC Y;
varobs PIE R Y;
stoch_simul(partial_information,irf=16) R PIE MC Y;[/code]

Thanks for reporting this. It is indeed a bug in the partial information code, which will be fixed in the next release.

In the meantime, you can use the version of PI_gensys.m attached to this message, and which contains the fix.
PI_gensys.m (8.32 KB)

Thanks a lot, Sebastian.

There is a second bug in “dr1_PI.m” on line 356 which reads

The output from "eu ~=[1; 1] " is not a scalar.

One possible correction might be



Thanks, I have fixed that too.