# Model consistent OLS estimation

Hi everybody,

I’m trying to get a model consistent OLS estimate. In detail (and simplifying), I have two variables, x and y, which are generated from the stoch_simul of the model. I want to find the model consistent estimate of the beta of the following regression:

y = beta*x + u ;

At each t, I define the model consistent estimate of beta as:

beta = c/v ;

where:

c = x_times_y(+1) - ex_x*ex_y ;

v = ex_x_sq - ex_x^2 ;

and:

ex_x = x(+1) ;

x_sq = x^2 ;

ex_x_sq = x_sq(+1) ;

ex_y = y(+1) ;

x_times_y = x*y ;

However, since in steady-state both c and v are zero, the solver is not able to find an approximation around the steady state for beta.

Anyone can help me solving this problem?

I am not sure you can do that within the model-block itself. You can easily compute second moments based on a first approximation of the model. But you cannot compute the second moments within a first order approximation.

I’m using a second order approximation. I think the problem is the indefinite form in steady state (0/0). The thing is that I need to get the residuals of the regression as an endogenous variable in the model.

Ps: thank you very much for your help! That sounds like the same problem that appears in portfolio choice models, i.e. that the steady state is essentially indeterminate in this case.

Any guess about how I might solve it?

My hunch is that it does not work with standard perturbation. Have you encountered a solution in the literature before?

Sadly I haven’t. I’m thinking that perhaps I can use a recursive OLS method updating beta at each time t. Have you ever implemented it in dynare?

That is something that one should be able to do. People have done similar things in the learning literature.

Do you know any example code?

Not really, but Time series simulation (simult_) for counterfactual analysis with adaptive learning comes to mind.

Thank you very much Professor!

Dear Professor,

I have another (unrelated) question: where are the epilogue block variables stored?

Can you provide more context? And did you see How to really use epilogue variables? - #5 by Ceada?