help-octave
[Top][All Lists]
Advanced

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

## Re: request for help with fmins or fminbnd

 From: Søren Hauberg Subject: Re: request for help with fmins or fminbnd Date: Fri, 31 Aug 2007 17:02:02 +0200 User-agent: Thunderbird 1.5.0.12 (X11/20070604)

```Hi,
```
I'm not quite sure what your question is, but I get the feeling that your problem is with passing parameters to the function you wish to minimize. I rarely use 'fmins', so I don't know if it has any quirks you need to work around. However, if your just having problems with passing arguments, I guess you could do something like this:
```
f = @(x) Likelihood_pois1(x, pir, boundslowmax, boundsupmax);
fmins(f, initparammax)

Søren

Tracy Feldman skrev:
```
```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 <mailto: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. <http://us.rd.yahoo.com/evt=48248/*http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz>
```

------------------------------------------------------------------------

_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave
```
```
```

reply via email to

 [Prev in Thread] Current Thread [Next in Thread]