Questions tagged [fminsearch]

For questions about the Matlab function fminsearch that computes the unconstrained minimum of a given function with the Nelder-Mead algorithm.

SYNOPSIS

x = fminsearch ( costf , x0 )
x = fminsearch ( costf , x0 , options )
[x,fval,exitflag,output] = fminsearch ( costf , x0 , options )

Description

This function searches for the unconstrained minimum of a given cost function.

The provided algorithm is a direct search algorithm, i.e. an algorithm which does not use the derivative of the cost function. It is based on the update of a simplex, which is a set of k>=n+1 vertices, where each vertex is associated with one point and one function value. This algorithm is the Nelder-Mead algorithm.

source

122 questions
2
votes
1 answer

Matlab: Incorrect estimates returned by fminsearch

I am trying to maximize a log-likelihood function of an autoregressive process (AR(1)) ERS(t) = 1+ 0.3*ERS(t-1) + epsilon(t) in order to estimate the parameters. Maximizing the log -likelihood involves finding the derivatives and so I thought of…
SKM
  • 959
  • 2
  • 19
  • 45
2
votes
0 answers

Matlab: finding the maximum point in for loop

For two variable function, say f(x,y)=x^2+y+b, where b is: b=raylrnd(1*sqrt(2/pi),10^6,1) %% b is 1x1000000 vector and subject to the constraint that: 2*x+1<=b. I want to find the maximum of the function for a interval say x is between [-10,10],…
kuku
  • 281
  • 2
  • 5
  • 12
2
votes
1 answer

MATLAB fminsearch with varargin

The MATLAB documentation for fminsearch does not include a form like x = fminsearch(fun,x0,options,varargin) but such a form exists; I have used it. For example: function[z] = myFunction(x,a,b,c) z = a * x^2 + b * x + c; end x0 = 0.0; a = 2; b…
LarrySnyder610
  • 2,277
  • 12
  • 24
2
votes
1 answer

Why fminsearch doesn't estimate parameters?

I'm trying to estimate the parameters of the following function: u = log(x) - ω - φ*(log(h)) - δ1*z - δ2*(z^2-1) I'm using the function fminsearch in matlab with the following codes: data = xlsread('return_oc_out.xlsx'); a = data(:,25); kernel =…
2
votes
1 answer

Matlab fminsearch Hessians?

A warning that Im very new to this and out of my depth, so apologies if this is novice or unclear. Im estimating parameters using fminsearch for a number of datasets and it has been suggested that we should try to plot hessians for the fit for each…
2
votes
3 answers

fminsearch is overwriting in loop while storing data

I have the code mentioned below in matlab. I want to write all the 162 rows and 4 columns calculated into an excel file. When i use xlswrite in the code i get only one row and 4 columns as the value of P gets overwritten in each iterative step. If i…
2
votes
0 answers

neldermead fminsearch R

OBJECTIVE: I have a known matrix A and a matrix C. C is a function of some unknown matrix B.C and A should be almost equal.So I try to minimize A-C with B as unknown which I want to find. I select the fminsearch for this. 1) In my cost function I…
Mayank Raj
  • 121
  • 2
  • 12
2
votes
4 answers

How to determine the total running time when using the fminsearch in MATLAB

does anyone here got an idea what is the command that i should use in MATLAB to determine the total computer time taken to run the Nelder-Mead algorithm using FMINSEARCH until it stop. TQ
1
vote
1 answer

Matlab fminsearch Error : Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 72-by-1

I am trying to do a curve fitting using Matlab fminsearch. Here is what I wrote : Idata = readtable('Data_batterie.xlsx','Sheet','C(T)','Range','A1:A72'); Idata = table2array(Idata); Tdata =…
Hurrdof
  • 23
  • 5
1
vote
1 answer

how can I write a constraints(x) in matlab 'fminsearch' like 'fmincon'

hi guys I have some problem I coding some optimization one 4 variables f(x1,x2,x3,x4) so...I was using 'fmincon'...but it doesn't work very well here is the Question how can I write a constraints(x) in 'fminsearch' like…
dolx20
  • 11
  • 1
1
vote
2 answers

How to plot the trajectory that fminsearch follows?

I am trying to optimize rosenbrock's function with fminsearch and also drawing the point that gives the minimum value with point size being proportional to the iteration number at each iteration on the 2-D contour plot of rosenbrock's function,…
Burak Kaymakci
  • 662
  • 2
  • 16
  • 36
1
vote
1 answer

Matlab use fminsearch to optimize multi variables

I am using Matlab fminsearch to minimize a equation with two variables sum((interval-5).^2, 2)*factor The interval is a vector contains 5 values. They can be only picked sequentially from value 1 to 30 with step size is 1. The factor is a value from…
SimaGuanxing
  • 673
  • 2
  • 10
  • 29
1
vote
0 answers

Applying a change of variables inside fmincon

(Disclaimer: I also posted to mathworks in the hope of a speedy answer. I hope this is not frowned upon.) I want to minimize a very well-behaved real-valued objective function $f$ from R^I. Feasible points are inside the convex hull of a finite set…
mimuller
  • 155
  • 6
1
vote
1 answer

why do i get fminsearch undefined function error

I'm trying to optimize a function with 2 inputs. Trying to use fminsearch but it keeps saying undefined function or variable although it is already defined. I have already defined the function in a separate script that is in the same directory with…
1
vote
1 answer

Using fminsearch for parameter estimation

I am trying to find log Maximum likelihood estimation for Gaussian distribution, in order to estimate parameters. I know that Matlab has a built-in function that does this by fitting a Gaussian distribution, but I need to do this with logMLE in…
Frankova T
  • 33
  • 6
1
2
3
8 9