# Help! how to calculate the area of a circle from time to from time

Plz Help!
I just want to build a simple model to calculate the area of a circle from time to from time. Dynare didn’t report error, but the result (the circle area) is strange and wrong, can anyone tell me what is the problem and how to fix it? Here is the code:

varexo ea;
parameters rho sigma;
rho = 0.9;
sigma = 0.5;

model;
v = rho* v(-1) + ea;
% the area of the circle
no_use=0.9* no_use(+1)+v;
% no_use is only for use of “order=2” in stoch_simul
end;

initval;
end;
check;
shocks;
var ea; stderr sigma;
end;
stoch_simul(order=2,irf=200) ;

here is the result:

I am not sure I understand what you are trying to do. The problem here is mostly random shocks happening and your number if `replic` being to small to generate smoother GIRFs.

Thx for answering , Professor jpfeifer. What I try to do is to calculate the area of a circle, which is circle = 3.14159 * radii^2. But as you can see in the picture, circle definitely doesn’t satisfy the equation, and the IRF of circle isn’t smooth, I just want to know why and how to get the right picture .
I am not sure your meanning of “number too small”. in the code, I let stderr(radii)=0.5, I think it is large enough to generate smooth IRF, right?
If I still don’t make myself clear, plz tell me.

You don’t want GIRFs. Try

``````var v radii circle no_use;
varexo ea;
parameters rho sigma;
rho = 0.9;
sigma = 0.5;

model;
v = rho* v(-1) + ea;
% the area of the circle
no_use=0.9* no_use(+1)+v;
% no_use is only for use of “order=2” in stoch_simul
end;

initval;
end;
check;
shocks;
var ea; stderr sigma;
end;
stoch_simul(order=2,irf=0) ;

ex_=zeros(200,1)
ex_(1)=1;
y_=simult_(M_,options_,oo_.dr.ys,oo_.dr,ex_,options_.order)
circle_pos=strmatch('circle',M_.endo_names,'exact');