# Hi; What is the cause of the following error? y is not a parameter

``````// 2-period OLG, closed economy//

var y k w s r cy co D Check Check2 e1 e2;
predetermined_variables k;

// Exogenous variables are TFP, tax rate and government consumption
varexo A teta b;

parameters T beta m alpha delta sigma1 rho1 sigma2 rho2;

T = 40;
beta = 0.98;// discount rate
m = 0.9;// myopia factor
delta = 0;// depreciation
alpha = 0.412;// labor share of income
sigma1 = 0.138;
rho1 = 0.95;
sigma2 = (0.007)/(1-alpha);
rho2 = 0.95;

//model(differentiate_forward_vars=(D));
y = A*k^(1-alpha);
r + delta = (1-alpha)*(A*k^(-alpha));
w = alpha*y;
1/cy = beta*(1-m)*((1+r(+1))/(co(+1)));
cy = w*(1-teta) - s;
co = (1+r)*s(-1)+b;//R = 1+r
k(+1)= s + k*(1-delta) - D;
D(+1) = b - w*teta + D*(1+r);
Check = y - (r+delta)*k - w;
Check2 = y - cy - co - s - (1-delta)*k(-1)*(r) - w*teta + D*(1+r);

///model(differentiate_forward_vars=(D));
yss = A*kss^(1-alpha);
wss = alpha*yss;
1/cyss = beta*(1-m)*((1+r(+1))/(coss(+1)));
cyss = wss*(1-teta) - sss;
coss = (1+r)*s(-1)+b;//R = 1+r
kss = 1;
D(+1) = b - wss*teta + Dss*(1+r);

// Shock to equity returns
e1 = rho1 * e1(-1) + teta;

// Shock to productivity
e2 = rho2 * e2(-1) + b;

end;

//************** Declare initial values **************//

initval;

k  = kss;
cy = cyss;
co = coss;
w  = wss;
y  = yss;
s = sss;
D = Dss;
Check = 0;
Check2 = 0;
end;

//************** Debugging **************//
resid(1);
check;
model_diagnostics;

//************** shocks **************//
shocks;

var teta = sigma1^2;
var b = sigma2^2;
end;

stoch_simul(periods=3000);
``````

Altough I think that you did not set \star for some variables in your equations.

error: y is not a parameter

I think that you did not set * for some of your equations in the model.
For example in the first equation or production function:

y=A*k^(1-alpha) ;

You commented out the `model;` statement.

I don’t think this is true because the model provided steady state values with the same appearance
bbb.mod (1.1 KB)

In your first post * sign was not ready for many equations of the model.
It seems that you reformed the model.

When you post text without putting it into ```, then the * sign is the sign for italics. I had reformatted the original post.

Again, you commented out the model-statement:

``````//model(differentiate_forward_vars=(D));
``````

// is the command for comments.