Steady state and fminsearch

Hello everyone!

I’m computing two steady states simultaneously, say, relative PPI price p_{H} and home output Y_H, via the MATLAB function fminsearch.

In a previous project, this function works pretty good and quick. But it reports error in my current one. Then I compare the two situations by 3D graphs and corresponding 2D contours. The x-axis is p_H, y-axis for Y_H.

The value function’s surface is fairly concave in the previous one, such that fminsearch can easily find the local minimum (zero), while the surface is a bit flat/even around the true p_H and Y_H.

Since fminsearch applies the homotopy algorithm, I guess the flat “shape” of the value function perplexes the simplex. Maybe a smaller simplex will go through (I don’t know how to set it).

To bypass this problem, I adjust TolFun and TolX from 1e-20 to 1e-5 for example. Dynare tells me two things:

First

Optimization terminated:
 the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-20 
 and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-20

QUESTION 1

It seems that as long as the fminsearch session is called from the steady state block of the Dynare mod file (I write this computation in a separate MATLAB m-file, and when Dynare runs the steady state block in mod-file, Dynare calls this m-file), TolFun and TolX are always 1.000000e-20 ?

I notice that finally p_H and Y_H are not solved out. They do not appear in Workspace window.


Second,
Dynare reports Residuals of the static equations:

Equation number 26 : -1.9736e-05 : MarketClearing
Equation number 28 : -4.6414e-05 : CountryBudgetConstraint

Notice that the errors are in 1e-5, rather than 1e-20.

QUESTION2

Following my previous question, considering the flat shape of the value function or the nature of my model, can I change the internal precision of Dynare from 1e-20 to 1e-5 ? After all, the default TolFun and TolX for fminsearch itself are indeed/only 1e-4.


Moreover, I’m not sure whether lowering the computational precision has any significant problem for future stochastic simulation. You might suggest modifying my economic model, but it is much time-consuming!

Thank you in advance! Sincerely :coffee: :coffee: :coffee:

I would need to see the codes for give an answer.

Thank you for the reply! Since the deadline for this project is approaching, I then solve the steady state part analytically. Yes, Equation 26 and 28 still have problems. I’m now reviewing my model settings and codes.