Page 1 of 2
How to find steady state normcdf??
Posted:
Sat Mar 16, 2013 6:02 am
by kokotaro
hello everybody!! I'm a new user. Please tell me how to find steady state for normcdf function??
Example :
- Code: Select all
1+ PHI_D_ss = zph_D_ss/(g_D_ss*zph_D_ss - z_D_ss*gph_D_ss);
z1_D_ss = (log(omega_D_ss)+0.5*Sigma^2)/Sigma;
z2_D_ss = (log(omega_D_ss/exp(RHO_D_ss))+0.5*Sigma^2)/Sigma;
z_D_ss = 1 - (z1_D_ss - S)- omega_D_ss*(1-normcdf(z1_D_ss)) ;
g_D_ss = exp(RHO_D_ss)*(omega_D_ss/exp(RHO_D_ss)*(1-normcdf(z2_D_ss)) + (1-mu_D)*normcdf(z2_D_ss - Sigma));
zph_D_ss = -(1 - normcdf(z1_D_ss));
gph_D_ss = exp(RHO_D_ss)*(1-normcdf(z2_D_ss) - mu_D/(sqrt(2*3.14159)*S)*exp(-z2_D_ss^2/2));
What should i do to find "omega_D_ss" and "sigma" in initval???(PHI_D_ss is a paremeter, RHO_D_ss=1). Help me, please!!
Re: How to find steady state normcdf??
Posted:
Sat Mar 16, 2013 8:17 pm
by jpfeifer
Compute it with pencil and paper as far as possible. Then use norminv to invert the cdf and back out the SS values. If needed, use a steady state file.
Re: How to find steady state normcdf??
Posted:
Sun Mar 17, 2013 11:23 am
by kokotaro
thank you for your answer!! How can i create a steady state file?? Can you give me an example? Thank you
Re: How to find steady state normcdf??
Posted:
Sun Mar 17, 2013 11:46 am
by jpfeifer
Re: How to find steady state normcdf??
Posted:
Mon Mar 18, 2013 10:03 am
by kokotaro
Thank you so much.
Re: How to find steady state normcdf??
Posted:
Mon Mar 18, 2013 1:42 pm
by kokotaro
I have found another steady state value, It says:
- Code: Select all
Residuals of the static equations:
Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0.012254
Equation number 13 : 0
Equation number 14 : 0
Equation number 15 : 0.01
Equation number 16 : 0
Equation number 17 : -0.91378
Equation number 18 : 0.1593
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : 0
Equation number 23 : -0.73927
Equation number 24 : -0.41629
Equation number 25 : 0
Equation number 26 : 0
Equation number 27 : 0.64973
Equation number 28 : 0
Equation number 29 : 0
Equation number 30 : 0
Equation number 31 : 0
Equation number 32 : 0
Equation number 33 : 1.7183
Equation number 34 : 0
Equation number 35 : 0
Equation number 36 : 3.2029
Equation number 37 : -0.53277
Equation number 38 : 0
Equation number 39 : 0
Equation number 40 : 0
Equation number 41 : 0
Equation number 42 : 0
Equation number 43 : 0
Equation number 44 : 0
Equation number 45 : 0
Equation number 46 : 0
Equation number 47 : 0
Equation number 48 : 0
Equation number 49 : 0
Equation number 50 : 0
Equation number 51 : 0.0088416
Equation number 52 : 0
Equation number 53 : 0
Equation number 54 : 0.01
Equation number 55 : -0.11085
Equation number 56 : 0.00075411
Equation number 57 : 0.014692
Equation number 58 : 0.032228
Equation number 59 : 0
Equation number 60 : 0
Equation number 61 : 0
Equation number 62 : 0
Equation number 63 : -0.62442
Equation number 64 : -0.0040315
Equation number 65 : 0
Equation number 66 : 0.0047727
Equation number 67 : 0
Equation number 68 : 0.005
Equation number 69 : 0
Equation number 70 : 0
Equation number 71 : 0
Equation number 72 : 0
Equation number 73 : 0
Equation number 74 : 0
Equation number 75 : 0
Equation number 76 : 0
Equation number 77 : 0
Equation number 78 : 0
Equation number 79 : 0
Error using erfc
Input must be real and full.
Error in normcdf (line 90)
p(todo) = 0.5 * erfc(-z ./ sqrt(2));
Error in BAINHAP_static (line 60)
T585 = 1-normcdf(T583,0,1);
Error in csolve (line 112)
f=feval(FUN,x+dx,varargin{:});
Error in dynare_solve (line 141)
[x,info] = csolve(func,x,func,1e-6,500,varargin{:});
Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname '_static'],...
Error in steady_ (line 54)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);
Error in BAINHAP (line 811)
steady;
Error in dynare (line 120)
evalin('base',fname) ;
What should i do now?
Re: How to find steady state normcdf??
Posted:
Mon Mar 18, 2013 2:52 pm
by jpfeifer
You are still not using a correct steady state file. If you continue without it, provide better starting values that make the residuals as close to 0 as possible. Use Matlab debugging to look what is contained in T583, which leads to a crash in erfc.
Re: How to find steady state normcdf??
Posted:
Tue Mar 19, 2013 9:51 am
by kokotaro
OMG!!! I can't find a new steady state value. Please help me!!! I don't know what i should do now.
Re: How to find steady state normcdf??
Posted:
Tue Mar 19, 2013 9:56 pm
by jpfeifer
Now your steady state file is working. However, you still do not provide an analytical steady state. Given the size of your model there seems no other way. Use pen and paper to reduce the model to a few key equations and then use a solver like fsolve inside the steady state file to solve the remaining system of equations.
Re: How to find steady state normcdf??
Posted:
Wed Mar 20, 2013 8:05 am
by kokotaro
I have a question. How much is "close to 0"? I think my residuals is so close to 0. But it still says "The steadystate file did not compute the steady state". What is happening?? Thank you!!
- Code: Select all
Warning: File not found or permission denied
> In BAINHAP at 20
In dynare at 120
Residuals of the static equations:
Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0.0075
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0
Equation number 13 : 0.012254
Equation number 14 : 0
Equation number 15 : 0
Equation number 16 : 0
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : 0
Equation number 23 : 0
Equation number 24 : 0
Equation number 25 : 0
Equation number 26 : 0.02
Equation number 27 : 0
Equation number 28 : 0
Equation number 29 : 0
Equation number 30 : 0
Equation number 31 : 0
Equation number 32 : 0
Equation number 33 : 0
Equation number 34 : 0
Equation number 35 : 0
Equation number 36 : 0
Equation number 37 : 0
Equation number 38 : 0
Equation number 39 : 0
Equation number 40 : 0
Equation number 41 : 0
Equation number 42 : 0
Equation number 43 : 0
Equation number 44 : 0
Equation number 45 : 0
Equation number 46 : 0
Equation number 47 : 0
Equation number 48 : 0
Equation number 49 : 0
Equation number 50 : 0.0088416
Equation number 51 : 0
Equation number 52 : 0
Equation number 53 : 0
Equation number 54 : 0
Equation number 55 : 0.00075411
Equation number 56 : 0.014692
Equation number 57 : 0.032228
Equation number 58 : 0
Equation number 59 : 0
Equation number 60 : 0
Equation number 61 : 0
Equation number 62 : 0
Equation number 63 : 0
Equation number 64 : 0.0053455
Equation number 65 : 0
Equation number 66 : 0.005
Equation number 67 : 0
Equation number 68 : 0
Equation number 69 : 0
Equation number 70 : 0
Equation number 71 : 0
Equation number 72 : 0
Equation number 73 : 0
Equation number 74 : 0
Equation number 75 : 0
Equation number 76 : 0
Error using print_info (line 55)
The steadystate file did not compute the steady state
Error in resid (line 116)
print_info(info,options_.noprint)
Error in BAINHAP (line 495)
resid(1);
Error in dynare (line 120)
evalin('base',fname) ;
Re: How to find steady state normcdf??
Posted:
Wed Mar 20, 2013 9:33 pm
by jpfeifer
Zero. The problem is that a steady state file delivers Dynare the correct steady state. Otherwise, you just provide initial values. Those must be provided in initval.
Given that only 9 out of 76 equations have a residual, finding the solution for the others should not be so hard.
Re: How to find steady state normcdf??
Posted:
Thu Mar 21, 2013 1:36 pm
by kokotaro
Thank you so much for your help. I have had steady state value already. And it still has an other problem. I will try my best to find it in other topic in this forum to solve it. Thank you again
!!! (ps: please give me an advice if you can, thanks)
- Code: Select all
STEADY-STATE RESULTS:
C_HD 0.630523
C_MD 0.579325
C_D 1
C_HF 0.0953346
C_MF 0.90492
C_F 1
p_HD 1.41488
p_MD 0.186224
p_D 1
p_HF 1.10027
p_MF 0.989155
p_F 1
mc_D 1.28626
mc_F 1.00024
p_XD 1.41488
p_XF 1.10027
I_D 1
I_F 1
I_HF 0.0953346
I_MF 0.90492
K_D 40
K_F 40
Q_D 1
Q_F 1
THETA_D 0.99
THETA_F 0.99
RHO_D 1
RHO_F 1
om_D 0.174605
om_F 0.174605
z_D 0.825395
g_D 0.174605
zph_D -1
gph_D 1
z_F 0.825395
g_F 0.174605
zph_F -1
gph_F 1
i_D 0.010101
i_F 0.010101
r_KD 1.0303
r_KF 1.01515
D_ED 7.12388
D_EF 7.01912
C_ED 0.432007
C_EF 0.113955
C_EHD 0.27239
C_EHF 0.0108638
C_EMF 0.10312
y_D 4.91376
y_HD 4.52808
y_XD 0.385681
y_F 4.58763
y_HF 1.07424
y_XF 3.51338
y_MD 1.40892
y_MF 1.91296
w_ED 0.0410823
w_EF 0.0298268
nw_D 32.8761
nw_F 32.9809
w_D 2.54796
w_F 2.05823
n_D 1.58879
n_F 1.42949
h_D 1.59623
h_F 1.43466
D_HD 0.919908
D_HF -3.43853
pi_D 1
pi_F 1
psi_Dt 0
r_D 0.055303
r_F 0.0401515
PHI_D 0.02
PHI_F 0.005
Error using print_info (line 36)
The generalized Schur (QZ) decomposition failed. For more
information, see the documentation for Lapack function dgges:
info=40, n=38
Error in check (line 76)
print_info(info, options.noprint);
Error in BAINHAP (line 498)
oo_.dr.eigval = check(M_,options_,oo_);
Error in dynare (line 120)
evalin('base',fname) ;
Re: How to find steady state normcdf??
Posted:
Thu Mar 21, 2013 3:22 pm
by jpfeifer
Use
- Code: Select all
model_diagnostics(M_,options_,oo_)
to see where the problem comes from.
Re: How to find steady state normcdf??
Posted:
Fri Mar 22, 2013 3:24 am
by kokotaro
I have done that. But, i don't know what it means. And what i should do. I have already research for solusion, it still doesn't have a suitable solusion.
Re: How to find steady state normcdf??
Posted:
Fri Mar 22, 2013 7:50 am
by jpfeifer
It means there is collinearity. You are missing one equation and instead have a redundant one. Could be a copy and paste error, a timing mistake or e.g. a missing market clearing condition/problem with Walras Law.