[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
request for help with fmins or fminbnd
From: |
Tracy Feldman |
Subject: |
request for help with fmins or fminbnd |
Date: |
Thu, 30 Aug 2007 19:34:13 -0700 (PDT) |
To whom it may concern:
I am trying to convert a program that had worked well in Matlab, so that I can use an equivalent program in Octave (I no longer have access to Matlab). The program calculates the maximum likelihood estimate and the best-fit parameters for a function (finding poisson confidence limits, in this case, or in other cases, fitting a logistic function with binomial error). I have run into difficulties with the fmins function (which I have used in Octave to replace fminsearch in Matlab). I am trying to call my likelihood function as follows:
[maxparam, maxlike] = fmins(@Likelihood_pois1, initparammax, [], [], pir, boundslowmax, boundsupmax);
where
maxparam is a vector of two values of the maximized function
Likelihood_pois1 is the likelihood function (which I could send if it would help)
initparammax is a vector of two initial
parameter values
the two [] sets are for Options and GRAD, respectively
pir is a response variable (the data)
boundslowmax is a vector of two lower bounds of the parameter values
boundsupmax is a vector of two upper bound of the parameter values
It is received by the Likelihood function as follows:
function neglogL = Likelihood_pois1(pp, initparammax, pir, boundslowmax, boundsupmax);
I am not sure what would be the correct syntax, but whatever order I choose for the variables in parentheses (or if I get rid of one or both of the empty brackets) I get an error message saying invalid vector index = 4 (or some other #), and that fmins cannot perform any of several binary operations.
I have also tried converting to syntax for fminbnd, hoping it would be better, but this will not work for me either. Is this more than a simple syntax
issue?
I would appreciate any suggestions you might have (or if you would like more code from me and/or the program files, I can send more--or original files that worked in Matlab).
I really appreciate your time and help. I am not currently subscribed to the list, so if you can, please respond to me directly at
address@hidden.
Sincerely,
Tracy S. Feldman
Postdoctoral Associate
The Samuel Roberts Noble Foundation
Ardmore, OK 73401
Got a little couch potato?
Check out fun summer activities for kids.
- request for help with fmins or fminbnd,
Tracy Feldman <=