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

fminsearch censored MATLAB

EDIT I found that y(c) in my script gives this error: Subscript indices must either be real positive integers or logicals. but in the example script y(c) prints the values of y that are censored. I am trying to use a script that I found for…
Matt Majic
  • 381
  • 9
  • 18
0
votes
1 answer

Matlab: Determinant of VarianceCovariance matrix

When solving the log likelihood expression for autoregressive models, I cam across the variance covariance matrix Tau given under slide 9 Parameter estimation of time series tutorial. Now, in order to use fminsearch to maximize the likelihood…
SKM
  • 959
  • 2
  • 19
  • 45
0
votes
1 answer

Matlab minimize norm to find coefficients using fminsearch

I am trying to use minimization to calculate coefficients of the polynomial p(x) = 1 + c(1)x + c(2)x^2 to approximate e^x. I need to use points xi = 1 + i/n for natural numbers i on [1,n], first for n=5, then n=10, etc. The approach is to minimize…
LuckyPenny
  • 39
  • 6
0
votes
0 answers

anynomyous function in fminsearch function

let us consider following code function f = myfun(x,a) f = x(1)^2 + a*x(2)^2; a = 1.5; % define parameter first x = fminsearch(@(x) myfun(x,a),[0,1]) i can't understand what is role of anonymous function in such case?because we have fixed a=1.5;why…
user466534
0
votes
0 answers

Has fminsearch too many parameters?

I run this code in matlab to minimize the parameters of my function real_egarchpartial with fminsearch: data = xlsread('return_cc_in.xlsx'); SPY = data(:,25); dailyrange = xlsread('DR_in.xlsx'); drSPY= dailyrange(:,28); startingVals =…
0
votes
2 answers

Using Brent algorithm to find the root of a function f with an initial guess, but without intervals [a,b] s.t. f(a)f(b)<0

I would like to know how to use Brent algorithm if no opposite signs can be provided. For example, in the C++ library of Brent algorithm, the root-finding procedure that implements Brent’s method has to be used, following the header file, in the…
zell
  • 9,830
  • 10
  • 62
  • 115
0
votes
0 answers

Optimize the Function through fminsearch or fmincon

I have an function which describes the characteristics of Tracer in human brain The output c_t is a relation between tracer concentration and time. The rate constants K1,k2,k3 describe Kinetic rate constants of the Compartmental model following is…
0
votes
1 answer

fminsearch constraint using multiple paramters

Feel free to close this if I'm not understanding fminsearch or just butchering the lingo, but here's my question. Can I use fminsearch with a constraint on multiple parameters together? fminsearch(@(x) func(x(1), x(2)), [2,2], such that x(1) * x(2)…
Kingpin2k
  • 47,277
  • 10
  • 78
  • 96
0
votes
1 answer

MATLAB fminsearch for function minimization with 4 parameters

I need to minimize this function: A = sum(1:N) [(wi/constant)* y]; where y = P - P0 + 10*n*log( sqrt((xk-xi)^2 + (yk-yi)^2) ) I know P at different locations (i.e for different (xi,yi)). I have to find the parameters P0, n, xk, and yk which…
user2456984
  • 193
  • 2
  • 5
0
votes
2 answers

fminsearch with vector inputs

I want to minimize this function: function [GCV2]=GCV(y,x,k) [n,…
Bazman
  • 2,058
  • 9
  • 45
  • 65
0
votes
2 answers

Force entries of a matrix to be a variable

I have a square matrix that I need to use with fminsearch. Some of the values of the matrix need to be variable because they are the values that I will be using with fminsearch, and I need to preserve their location in the matrix. So for example,…
DaveNine
  • 391
  • 4
  • 21
0
votes
1 answer

MATLAB fminsearch equation using four anonymous parameters

I am a new MATLAB user and I need to find four co-efficients of an equation which calculates the core losses in an electric motor. I have already plotted the measured data on a graph and need to use these results to define an equation for this…
Robert
  • 1
  • 1
-1
votes
1 answer

Pycma - fmin Iterations

I'm using the library pycma to try and minimize some function by using the wrapper function cma.fmin. But for the life of me I can't figure out how many iterations this function runs for, and I'm a bit short on time. Any ideas on what parameter…
crommy
  • 433
  • 1
  • 4
  • 12
-1
votes
1 answer

MATLAB: Speed up fminbnd using vectorization

I am trying to optimize this piece of code. I am using the function fminbnd on a vector, splitting the task on its single entries using a loop. Would it be possible to speed it up vectorizing the process? for i = 1:A for ii= 1:B …
Luca Gi
  • 159
  • 7
-1
votes
1 answer

Matlab: nest fzero in fminsearch

I am trying to minimize with respect to a variable "y" a function that contains a parameter which must be calculated as a solution of an equality that contains "y" as well (say, y=-3; in my complete problem it is an equation with no analytic closed…
Giuseppe
  • 518
  • 10
  • 22
1 2 3
8
9