Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Non-linear Regression

    Dear all,
    I would like to estimate the following nonlinear regression:

    Click image for larger version

Name:	Bildschirmfoto 2025-02-12 um 15.23.09.png
Views:	1
Size:	18.1 KB
ID:	1772576

    where β0​, β1and λ should be numerically optimized such that the sum of squared residuals (SSR) is minimized.
    The objective is therefore:
    Click image for larger version

Name:	Bildschirmfoto 2025-02-12 um 15.24.00.png
Views:	1
Size:	27.1 KB
ID:	1772577


    I have two questions and would be very grateful for any help or suggestions:
    1. How should I formulate the nl command? I keep getting the error message: "expression too long."
    2. Can this problem be solved using the ml command or is there another suitable command I have not considered yet?
    Thank you very much in advance for any guidance!

  • #2
    You might consider trying –gmm– but I'd be concerned there as well that 109 summands, each of which has 109 summands in the denominator, might be overwhelming.

    One thought would be try try –gmm– with a much smaller number of summands (e.g. sum from 2018-2022) and see if that works as a proof of concept.

    Any ideas Enrique Pinzon (StataCorp) ?

    Comment


    • #3
      Hi Theresa and John,

      I think if you can share your data and code here in the forum and also send it to [email protected] we might be able to get better answers.

      Also, Theresa, is there a reference or a paper you are following? To the right of Beta1, in the first expression, you have a constant. I think you want it to vary or am I missing something.


      Last edited by Enrique Pinzon (StataCorp); 13 Feb 2025, 08:33.

      Comment


      • #4
        To the right of Beta1, in the first expression, you have a constant.
        I could be misunderstanding, but I think lambda in the exponent is a parameter that should be optimized. Are 1914 and 2022 years here?

        Comment


        • #5
          Hi Daniel,

          I think I was not clear. I understand that Theresa wants lambda, Beta0, and Beta1. What I have trouble understanding is the sum over -i- in the expression after Beta1, which eliminates the observation level variation. I suspect (and this is where we need more information) that the first sum runs over an index different than -i-.

          Comment

          Working...
          X