Giter VIP home page Giter VIP logo

Comments (6)

GabrieleRovigatti avatar GabrieleRovigatti commented on May 30, 2024

Dear Zhanyu,

thanks for the message.

Could you please provide some additional details (like, a MWE to make the issue reproducible on my system, possibly any detail on the system you are running on - R version, Rstudio version if any, windows/Linux/Mac etc.) in order for me to try to tackle the issue?

Thanks,

Gabriele

from prodest.

zydonghku avatar zydonghku commented on May 30, 2024

Dear Gabriele,

Thank you for your reply.

I run the package (the latest version) on Stata 14.0 on the Windows system. For example, I just run the following example code provided in your help files:

insheet using "https://raw.githubusercontent.com/GabrieleRovigatti/prodest/master/stata/data/prodest.csv", names clear

prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) acf opt(nm) reps(50) id(id) t(year) /* run twince */

prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) acf opt(nm) reps(30) id(id) t(year)

then you will see different results.

Thanks,
Zhanyu

from prodest.

GabrieleRovigatti avatar GabrieleRovigatti commented on May 30, 2024

Dear Zhanyu,

thanks for the message and the clarifications.

The issue you outlined with the acf models' estimation is pretty well-known (you might find a section in my paper regarding it and a relatively new paper dealing with the topic on the Journal of Applied Econometrics). It has to do with the optimization of the second stage - which is a non-linear GMM problem - and the starting points of the optimizer. It is true that - in general - such an issue would primarily affect the estimation of the standard errors during the bootstrap repetitions, but in particular cases the starting points might affect local maxima in different points of the parameter space, and give different optimization results.

A possible solution would be to set the seed before running the estimation.

I hope to have clarified,

from prodest.

zydonghku avatar zydonghku commented on May 30, 2024

Dear Gabriele,

Thank you for your reply.

Firstly, I tried to use your seed() option, but it reported the error "option seed() not allowed". I opened your ado file but found that you did not set the seed option in -prodest-, then I manually set the seed (-set the seed #- before running the estimation ) but still got the different results.
Secondly, my understanding is that at the first stage, you obtain starting points from a simple OLS at the first stage. If there is no any other randomness, we will have the same/consistent starting points through the OLS estimation, and thus, the estimated coefficients will not be changed no matter what optimization method we use. But I can still see the different estimated coefficients. Please inform me if I am wrong. Thanks.

Best regards,
Zhanyu

from prodest.

GabrieleRovigatti avatar GabrieleRovigatti commented on May 30, 2024

Dear Zhanyu,

I have discontinued the option seed() in prodest. What I was suggesting was to add "set seed " before running every estimation, in a way that every run of prodest runs on the same seed number.

Let me clarify on the first-stage / second-stage question: you rightfully outline that the first stage is a simple OLS estimation, but as you might know the ACF correction consists exactly in overcoming the first-stage results, and only rely on the second-stage results, also for the free variable parameter. In a nutshell, then, without acf correction you could run into the same issue, but for the state and proxy variables only.

To a more "official" side, I will close the issue because - on my system, at least - the following works and gives the same results every time

insheet using "https://raw.githubusercontent.com/GabrieleRovigatti/prodest/master/stata/data/prodest.csv", names clear
set seed 101
prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) acf opt(nm) reps(50) id(id) t(year) 
set seed 101
prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) acf opt(nm) reps(50) id(id) t(year) 

whereas, for different results in different rounds of estimation in the acf framework, please refer to my paper here.

Best,

Gabriele

from prodest.

zydonghku avatar zydonghku commented on May 30, 2024

Ok, thank you again for your reply. Hope to see your name on the AER in the near future :)

Best regards,
Zhanyu

from prodest.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.