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
0
votes
2 answers

Why matlab gives fminsearch optimisation error?

I have such an question, And I will do it in matlab. But, I get some errors: Find the value of x ∈ [0, 1] that minimizes the largest eigenvalue of the matrix A(x) = xM +(1−x)P, where M is a 5×5 magic square and P is a 5 × 5 Pascal matrix. My…
1190
  • 365
  • 2
  • 10
0
votes
1 answer

Translating Matlab fminsearch in to Python

I am converting some Matlab code into python and have a problem with fminsearch. I wonder if anyone can help me. method={'gausse' 'markov'}; subset=find(r>0 & r<=rMax); a{1}=fminsearch('myfunction',[10…
Blanka
  • 1
  • 1
0
votes
1 answer

Minimization of a variable with fminsearch involving many variables

I have an equation with a number of variables. I have to find minimum of variable a0, by giving the input to all other variables [a1, a2, a3, a4, a5, a6, x1]. x1 is an array and the other variables are constant for a constant a0 value. (The other 6…
Akshay
  • 3
  • 2
0
votes
1 answer

Solving system on non-linear equations (containing bivariate cumulative normal distribution function)

I am experiencing some struggles in solving a system of 4 equations with 4 unknows. The equations are non-linear and contain a bivariate normal cumulative distribution function. I tried multiple numerical optimization packages (fmincon, fminsearch,…
0
votes
0 answers

How to run parameters optimization for my model using the GPU

Essentially, I have a model with given a set of parameters is able to calculate different thermodynamic properties for different compounds, let's say liquid densities and vapor pressures for example. When I want to regress the model parameters (e.g.…
ECrespo
  • 135
  • 1
  • 1
  • 8
0
votes
1 answer

Saving functions of x that are not being optimised for optimisation matlab fmincon

I have a function with two outputs as such function [cost,correlation] = opt(beta, data, ind) I am minimizing the cost function, using options with fmincon I can plot beta and cost at each iteration and they are saved. How can I do the same with…
0
votes
1 answer

Stop fminsearch when objective function reach certain value

How to stop fminsearch when objective function exceeded certain value (minima or maxima) options = optimset('MaxFunEvals',9999); [x,fval,exitflag,output] = fminsearch(@(var)objectiveFunction(variables), changingParameters,options); How to stop…
Adnan j
  • 109
  • 10
0
votes
1 answer

Can I get Jacobian from fminsearch

I wonder if there is an easy way to get Jacobian out from fminsearch in Matlab ? like in [OptimizedParamters,residualsNorm,residual,exitflag,output,lambda,jacobian] = lsqnonlin(@function, …
0
votes
0 answers

Store fminsearch iterations

I'm minimizing a non-linear function of 3 variables with fminsearch in Octave. Because, the solution gets close to the minimum, but not close enough, I need to investigate the behavior during the iterations. I know that Matlab can set…
gciriani
  • 611
  • 2
  • 7
  • 19
0
votes
0 answers

Parallelizing fminsearch using the parfor loop?

I have a for loop in a curve fitting problem that needs to be parallelized using the parfor loop. Below is the for loop that works in single core, is there a way I can convert this to parfor? for initial_p = [1:1:1000] % initial condition for…
ShadowWarrior
  • 180
  • 1
  • 12
0
votes
0 answers

MATLAB error: non-singleton rhs dimensions than non-singleton subscripts

The following code runs fine and gives the accurate result. c1...c5 are known constants, and x(1)...x(5) (anonymous vector) are unknown variables which to be fitted by fminsearch using the least square method. (t,y) is the given data (curve) to fit…
ShadowWarrior
  • 180
  • 1
  • 12
0
votes
1 answer

Error in fminsearch to solve this 4-variable problem?

I am trying to solve the equation below using fminsearch, but I think the objective function is wrong. How should I write the objective function or modify any other part of the code? This is basically a fitting problem, where the optimization…
ShadowWarrior
  • 180
  • 1
  • 12
0
votes
2 answers

Find minimum and maximum of a two variable function on fixed interval in Matlab, and plotting those points in the same graph with the function

I have this function below and I need to calculate the minimum and maximum of this function U, and also plotting the maximum and minimum value in 3D graph together with the function. How can I write the code? [x,y]=meshgrid(0:0.1:pi,0:0.1:2*pi);%…
Yammus
  • 3
  • 2
0
votes
0 answers

Need a Global Optimisation Algorithm

I am working on a Global Optimization problem, whose algorithm is shown in figure (1). My objective is to find two values (Gamma12 and epsilon1) for a given value of epsilon2. I know that the upper and lower bounds of values Gamma12 and epsilon1…
0
votes
0 answers

python fmin optimize error (simplex downhill method)

I want to solve an fixpoint iteration with an fmin optimization. I dont know why I get an Error like: OVERFLOW ENCOUNTERS IN DOUBLE SCALAR: I know the results and the first optimization before printing Status: 0 ([ 2.85475105e-01 …
RyZ
  • 1
  • 1
1 2 3
8 9