How to find steady state normcdf?

hello everybody!! I’m a new user. Please tell me how to find steady state for normcdf function??
Example :

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!!

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.

thank you for your answer!! How can i create a steady state file?? Can you give me an example? Thank you

See the discussion at [Steady state file).

For a working example, see my post at [External MATLAB function in Dynare)

Thank you so much.

I have found another steady state value, It says:

[code]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) ;[/code]

What should i do now? :frowning:

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.

OMG!!! I can’t find a new steady state value. Please help me!!! I don’t know what i should do now.
BAINHAP_steadystate.m (6.82 KB)
BAINHAP.mod (8.22 KB)

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.

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]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) ;[/code]

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.

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 :slight_smile:!!! (ps: please give me an advice if you can, thanks)

[code]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) ;[/code]

Use

to see where the problem comes from.

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.
chay1_steadystate.m (8.73 KB)
chay1.mod (8.95 KB)

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.

OMG. I cannot find any copy and paste errror. I think i used almost equations in paper. [code]STEADY-STATE RESULTS:

C_HD 0.157316
C_MD 0.882245
C_D 1
C_HF 0.0289613
C_MF 0.971335
C_F 1
p_HD 1.41504
p_MD 0.881152
p_D 1
p_HF 1.09932
p_MF 0.996734
p_F 1
mc_D 1.2864
mc_F 0.999384
p_XD 1.76649
p_XF 0.880609
I_D 1
I_HD 0.157316
I_MD 0.882245
I_F 1
I_HF 0.0289613
I_MF 0.971335
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.2837
om_F 0.2837
z_D 0.718022
g_D 0.280505
zph_D -0.96798
gph_D 0.943521
z_F 0.716697
g_F 0.283018
zph_F -0.990222
gph_F 0.983801
i_D 0.010101
i_F 0.010101
r_KD 1.03031
r_KF 1.01511
D_ED 14.2872
D_EF 9.11336
C_ED 0.375811
C_EF 0.0989434
C_EHD 0.059121
C_EMD 0.331558
C_EHF 0.00286553
C_EMF 0.0961071
y_D 4.91391
y_HD 0.383298
y_XD 4.53061
y_F 4.58655
y_HF 0.0611235
y_XF 4.52543
y_MD 2.14958
y_MF 2.05003
w_ED 0.0410882
w_EF 0.0297942
nw_D 29.2567
nw_F 29.0318
w_D 2.54821
w_F 2.05673
n_D 1.58886
n_F 1.42897
h_D 1.59631
h_F 1.43413
D_HD -5.70939
D_HF -1.84305
pi_D 1
pi_F 1
psi_Dt 0
r_D 0.0553111
r_F 0.0401076
PHI_D 0.0200079
PHI_F 0.0049565
s_D 0.801047
s_F 1.24837
Error using print_info (line 36)
The generalized Schur (QZ) decomposition failed. For more
information, see the documentation for Lapack function dgges:
info=43, n=41

Error in check (line 76)
print_info(info, options.noprint);

Error in chay1 (line 517)
oo_.dr.eigval = check(M_,options_,oo_);

Error in dynare (line 120)
evalin(‘base’,fname) ;

[/code]
chay1_steadystate.m (7.67 KB)
chay1.mod (8.8 KB)