# Estimation, beta\_specification

**URL:** <https://forum.dynare.org/t/estimation-beta-specification/11708>\
**Category:** ML/Bayesian estimation\
**Created:** [21 April 2018 14:07 UTC](https://forum.dynare.org/t/estimation-beta-specification/11708 "2018-04-21T14:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moja](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/dfb087/32.png) [@moja](https://forum.dynare.org/u/moja)\
**Post date:** [21 April 2018 14:07 UTC](https://forum.dynare.org/t/estimation-beta-specification/11708/1 "2018-04-21T14:07:04Z")

</div>

hello  
whould you please help me. i am almost new on Dynare and i face a problem estimation and distribution section my error is (There are 3 eigenvalue(s) larger than 1 in modulus  
for 3 forward-looking variable(s)

The rank condition is verified.

You did not declare endogenous variables after the estimation/calib\_smoother command.  
Error using beta\_specification (line 63)  
Beta prior (for sigma). Given the declared prior expectation, prior lower and upper bounds, the prior std. has to be  
smaller than 0.000000.  
Error in set\_prior (line 171)  
[bayestopt\_.p6(k(i)), bayestopt\_.p7(k(i))] = beta\_specification(bayestopt\_.p1(k(i)), bayestopt\_.p2(k(i))^2,  
bayestopt\_.p3(k(i)), bayestopt\_.p4(k(i)), bayestopt\_.name{k(i)});  
Error in dynare\_estimation\_init (line 152)  
[xparam1,estim\_params\_,bayestopt\_,lb,ub,M\_] = set\_prior(estim\_params\_,M\_,options\_);  
Error in dynare\_estimation\_1 (line 115)  
[dataset\_, dataset\_info, xparam1, hh, M\_, options\_, oo\_, estim\_params\_, bayestopt\_, bounds] = …  
Error in dynare\_estimation (line 105)  
dynare\_estimation\_1(var\_list,dname);  
Error in nk (line 253)  
oo\_recursive\_=dynare\_estimation(var\_list\_);  
Error in dynare (line 223)  
evalin(‘base’,fname) ; )

my dynare codes are

// Variables  
var pi y Y rn i m\_r n a v;  
varexo eps\_v eps\_a;

// Parameters  
parameters beta epsilon theta sigma rho phi alpha phi\_pi phi\_y eta PSI\_yan THETA lambda kappa rho\_v rho\_a LAMBDA\_v LAMBDA\_a;  
beta = 0.99;  
sigma = 1;  
phi = 1;  
alpha = 0.333;  
epsilon = 6;  
eta = 4;  
theta = 0.666;  
phi\_pi = 1.5;  
phi\_y = 0.125;  
PSI\_yan = (1+phi)/(sigma\*(1-alpha)+phi+alpha);  
THETA = (1-alpha)/(1-alpha+alpha_epsilon);  
lambda = (1-theta)_(1-beta_theta)THETA/theta;  
kappa = lambda(sigma+(phi+alpha)/(1-alpha));  
rho = 1/beta-1;  
rho\_v = 0.5;  
rho\_a = 0.9;  
LAMBDA\_v = 1/((1-beta_rho\_v)_(sigma_(1-rho\_v)+phi\_y)+kappa\*(phi\_pi-rho\_v));  
LAMBDA\_a = 1/((1-beta_rho\_a)_(sigma\*(1-rho\_a)+phi\_y)+kappa\*(phi\_pi-rho\_a));

// Model  
model(linear);  
// Taylor-Rule  
i = rho+phi\_pi_pi+phi\_y_y+v;  
// IS-Equation  
y = y(+1)-1/sigma\*(i-pi(+1)-rn); // y is output gap  
rn=rho+sigma_PSI\_yan_(a(+1)-a); // natural rate of interest  
Y = PSI\_yan\*(1-sigma\*(1-rho\_a)_(1-beta_rho\_a)_LAMBDA\_a)a; // actual output;  
// Phillips Curve  
pi = betapi(+1)+kappa_y;  
// Money Demand  
m\_r = y-eta_i; // money demand; m\_r = m-p  
// Employment  
n = (((PSI\_yan-1)-sigma_PSI\_yan\*(1-rho\_a)_(1-beta_rho\_a)_LAMBDA\_a)/(1-alpha))a;  
// Autoregressive Error  
a = rho\_aa(-1) + eps\_a; // technology shock  
v = rho\_v_v(-1) + eps\_v; // shock to i )  
end;  
steady;

check;

// Shocks

shocks;  
var eps\_v = 0.0625;  
var eps\_a = 0;  
end;  
tech = 0;  
policy = 1;

varobs Y i;  
estimated\_params;  
beta, beta\_pdf, 0.99, 0.002;  
sigma, beta\_pdf, 1, 0.02;  
phi, beta\_pdf, 0.99, 0.0000001;  
alpha, normal\_pdf, 0.333, 0.222;  
theta, beta\_pdf, 0.666, 0.0225;  
phi\_y, normal\_pdf, 0.125, 0.005;  
eta, beta\_pdf, 0.99, 0.002;  
PSI\_yan,beta\_pdf, 0.99, 0.002;  
THETA,beta\_pdf, 0.99, 0.002;  
lambda,normal\_pdf, 4, 0.005;  
kappa,normal\_pdf, 4, 0.005;  
rho\_v,normal\_pdf, 4, 0.005;  
rho\_a,beta\_pdf, 1, 0.02;  
LAMBDA\_v,normal\_pdf, 0.333, 0.222;  
LAMBDA\_a,normal\_pdf, 0.333, 0.222;  
stderr eps\_v, inv\_gamma\_pdf, 0.01, inf;  
stderr eps\_a, inv\_gamma\_pdf, 0.01, inf;  
end;

estimation(datafile= DSGEDATA1, mode\_check, mh\_jscale=0.3, mh\_replic= 20000, mh\_nblocks=2, mode\_compute=5);  
stoch\_simul(periods=10000, irf=20);

could you please solve my dynare codes problem?

---

<div class="post-metadata">

**Author:** ![ShortRun](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@ShortRun](https://forum.dynare.org/u/ShortRun)\
**Post date:** [21 April 2018 14:15 UTC](https://forum.dynare.org/t/estimation-beta-specification/11708/2 "2018-04-21T14:15:22Z")

</div>

The beta distribution is defined over the interval [0 1] and you are setting the prior mean at the upper bound. You should set a lower prior mean for sigma. If instead you just want to calibrate sigma to 1, you should remove it from the estimated\_params section. I guess you have the same issue with other parameters where you are trying to set very tight priors.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [21 April 2018 18:54 UTC](https://forum.dynare.org/t/estimation-beta-specification/11708/3 "2018-04-21T18:54:38Z")

</div>

@ShortRun is correct. In addition, you are not handling parameter dependence correctly (search the forum on this)
