[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
KAI LIU <kliu@jhu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: mata code that calculates numerical partial derivates |

Date |
Tue, 12 Aug 2008 16:39:24 -0400 |

I am looking for mata code that will calculate numerical partial derivates of any given function, m(p) where p is a kx1 vector.. As a simple example consider the following transparent m(p) function Mata: p1=1 p2=3 m=p1^2+p2 I am looking for a routine that will return mprime=[2,1]. The only numerical gradients routine I can find is the Stata dydx command. This command, however, only gives derivatives of bivariate relationships. A more general Mata routine must exist since optimize uses numerical gradients to optimize f(p). It then returns the gradiants for the k optimized p’s, My application requires that I then evaluate the gradiants of another function of p (i.e. m(p)). Any help would be much appreciated. Kai * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: mata code that calculates numerical partial derivates***From:*"Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov>

- Prev by Date:
**Re: st: RE: RE: RE: RE: Question erase duplicates values** - Next by Date:
**st: Testing for serial correlation in residuals under panel data** - Previous by thread:
**st: FW: RE: RE: RE: Question erase duplicates values** - Next by thread:
**st: RE: mata code that calculates numerical partial derivates** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |