Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"G. Anderson" <ga274@cam.ac.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: Nonlinear least squares restrictions |

Date |
06 Jun 2013 09:29:28 +0100 |

Many thanks, Gareth On Jun 6 2013, tshmak wrote:

Hi Gareth,I think this is a linear regression rather than a nonlinear regressionproblem.Naively, we can just create a variable called year, run:reg y i.year##X, noconsThis would result in a different intercept and slope for each year.To make the average of b = 1, simply divide the year-specific slopes bythe average of the slopes, the average being your estimate of B.The only problem of this approach is that your slopes across years wouldnot meet at the boundary. To constraint the slopes to meet, you need touse splines. The best place to start is probably Roger Newson's -bspline-package. Dr. Newson has also written a few informative articlesexplaining their use in Stata Journal.HTH,Timps. I think the reason -nl- fails on this problem is that the problem isnot identified unless you can somehow constraint the b to average 1, andI'm not sure you can do that in -nl-.-----Original Message----- From: owner-statalist@hsphsun2.harvard.edu[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of G. AndersonSent: 05 June 2013 19:24 To: statalist@hsphsun2.harvard.edu Subject: st:Nonlinear least squares restrictionsHi,Using daily data, I am trying to estimate a relationship of the form y=a+bBX +uWhere a is a scalar which can vary across years, b is a scalar which canvary across years, X is a vector of data and B is a vector of parameterswhich is fixed across years.Therefore I am trying to estimate a, b and B. I want to normalise b sothat on average it is equal to 1 across years.I have tried experimenting using the nonlinear regression function but sofar to no avail- is this type of restriction possible in Stata?Many Thanks,Gareth* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: st: RE: Nonlinear least squares restrictions***From:*tshmak <tshmak@hku.hk>

**RE: st: RE: Nonlinear least squares restrictions***From:*Haluk Vahaboglu <vahabo@hotmail.com>

**References**:**st: Nonlinear least squares restrictions***From:*"G. Anderson" <ga274@cam.ac.uk>

**st: RE: Nonlinear least squares restrictions***From:*tshmak <tshmak@hku.hk>

- Prev by Date:
**Re: st: Wishlist for Stata 13 - index()** - Next by Date:
**Re: st: Nonlinear least squares restrictions** - Previous by thread:
**st: RE: Nonlinear least squares restrictions** - Next by thread:
**RE: st: RE: Nonlinear least squares restrictions** - Index(es):