[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about the function 'fmins'
From: |
Michael Creel |
Subject: |
Re: question about the function 'fmins' |
Date: |
Wed, 31 May 2006 09:58:35 +0200 |
User-agent: |
Thunderbird 1.5.0.2 (X11/20060522) |
For fitting by ML, I have some code in octave-forge that should do the trick.
Just examine the file mle_example.m, in the main/econometrics subdir to see how
to use it. Here's some sample output:
octave:1> mle_example
analytic score, unscaled data
******************************************************
Poisson MLE trial
MLE Estimation Results
BFGS convergence: Normal convergence
Average Log-L: -1.632551
Observations: 1000
estimate st. err t-stat p-value
beta1 1.013 0.011 93.503 0.000
beta2 1.994 0.015 133.783 0.000
beta3 2.996 0.002 1342.586 0.000
Information Criteria
CAIC : 3288.8256 Avg. CAIC: 3.2888
BIC : 3285.8256 Avg. BIC: 3.2858
AIC : 3271.1023 Avg. AIC: 3.2711
******************************************************
Cheers, Michael
Tracy Feldman wrote:
To whom it may concern:
I recently downloaded Octave (I believe it is the most recent version)
onto a windows machine (2000? I am not sure, sorry), and am starting to
convert Matlab files (that had worked correctly) into Octave files. I
am running into problems with the search algorithm 'fmins' (I had
previously used 'fminsearch' in Matlab, and I believe this is the
appropriate alternative in Octave?).
Specifically, I wish to minimize a likelihood function, and I wish fmins
to return *both* the Maximum likelihood estimate (it is negative, so it
is actually a minimum) and a vector with the best fit parameters to the
model I am fitting (in this case, a logistic equation, binomially
distributed).
I tried doing it this way:
[BestFitParametersVector, MaximumLikelihoodEstimate] =
fmins(@LikelihoodFunction, InitialParametersVector, [], [],
TrialsVector, SuccessesVector, Density, LowerBoundsVector,
UpperBoundsVector);
But the program did not accept two elements in left side of the
equation, specifying what the function returns. Is there a way to get
the function to return both of the things I want it to return? I am
not sure how best to define these "returned" variables in the Likelihood
function itself (if this is necessary), or to specify that the function
return these variables?
I would appreciate any ideas you might have on this. Please let me know
if you need more information from me (or if more code might help). If
possible, please respond directly to address@hidden
<mailto:address@hidden>, as I am not subscribed to the help
list. Thank you in advance.
Sincerely,
Tracy S. Feldman
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------------------------------------------------------
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave