Bookmark and Share

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]

Re: st: RE: Mata optimize: does moptimize_result_coefs(M) really work? CORRECTION


From   Tirthankar Chakravarty <[email protected]>
To   [email protected]
Subject   Re: st: RE: Mata optimize: does moptimize_result_coefs(M) really work? CORRECTION
Date   Thu, 8 Jul 2010 03:36:25 +0530

A reproducible example of what Jeremy is talking about can be had by
taking the example from the [M], pg. 616:
****************************************
clear*
sysuse auto, clear
mata:
// mata drop linregeval()
function linregeval(transmorphic M, real rowvector b, real colvector lnf)
{
real colvector p1, p2
real colvector y1

p1 = moptimize_util_xb(M, b, 1)
p2 = moptimize_util_xb(M, b, 2)
y1 = moptimize_util_depvar(M, 1)

lnf = ln(normalden(y1:-p1, 0, sqrt(p2)))
}
M = moptimize_init()
moptimize_init_evaluator(M, &linregeval())
moptimize_init_depvar(M, 1, "mpg")
moptimize_init_eq_indepvars(M, 1, "weight foreign")
moptimize_init_eq_indepvars(M, 2, "")
moptimize(M)
moptimize_result_coefs(M)  // chokes here.
moptimize_result_eq_coefs(M)
end
****************************************
There is a discrepancy here between the pdf manual and -mhelp
moptimize_result_coefs-. Whereas the latter includes references to
both -moptimize_result_coefs()- and -moptimize_result_eq_coefs()-, in
the pdf help, the functionality of -moptimize_result_eq_coefs()- is
subsumed into -moptimize_result_coefs()-, and only the latter finds
mention. And yet in the example above, it is
-moptimize_result_eq_coefs()- that actually functions. I believe
things are in a state of flux here.

T


2010/7/8 Prieger, James <[email protected]>:
>  Sorry, the question should have read:
>
> The Mata manual (M-5, page 605) says that the command
>
> moptimize_result_coefs(M)
>
> can be used to post results after optimization. However,
> 1) it doesn't seem to work, and
> 2) the Stata Do-file Editor doesn't seem to think it is a command,
> either (i.e., the Editor doesn't put it in blue type).
>
> Does anyone know if this is an error in the Mata manual?
> N.b. the closely related command "moptimize_result_eq_coefs(M)" _does_
> work, so I guess my question is more academic/beta-testing than anything
> else.
>
> James Prieger
> Associate Professor
> Pepperdine University School of Public Policy
>
> James Prieger
> Associate Professor
> Pepperdine University School of Public Policy
> 24255 Pacific Coast Highway
> Malibu, CA 90263
> (310) 506-7150 phone
> (310) 506-7494 fax
> office:  SPP 193
> http://faculty.pepperdine.edu/jprieger/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Prieger,
> James
> Sent: Wednesday, July 07, 2010 2:38 PM
> To: [email protected]
> Subject: st: Mata optimize: does moptimize_result_coefs(M) really work?
>
> The Mata manual (M-5, page 605) says that the command
>
> moptimize_result_eq_coefs(M)
>
> can be used to post results after optimization. However,
> 1) it doesn't seem to work, and
> 2) the Stata Do-file Editor doesn't seem to think it is a command,
> either (i.e., the Editor doesn't put it in blue type).
>
> Does anyone know if this is an error in the Mata manual?
> N.b. the closely related command "moptimize_result_eq_coefs(M)" _does_
> work, so I guess my question is more academic/beta-testing than anything
> else.
>
> James Prieger
> Associate Professor
> Pepperdine University School of Public Policy
>
> *
> *   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/
>
> *
> *   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/
>



-- 
To every ω-consistent recursive class κ of formulae there correspond
recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
belongs to Flg(κ) (where v is the free variable of r).

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index