Thread Subject: fminsearch and normalization

Subject: fminsearch and normalization

From: Dmitrey

Date: 26 Mar, 2007 11:06:52

Message: 1 of 3

afaik scaling possibility is absent in fminsearch.
try using ralg from openopt, in my examples it works better
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13115&objectType=file
prob=ooAssign(objFun, x0, <optional params>)
prob.useScaling=1;
if no prob.ScaleFactor is provided -> x0 will be used as scale factor
r=ooRun(prob, @ralg);
x=r.xf;
fval = r.ff;

WBR, D.

On Mar 26, 6:55 pm, Peter Bone <peterb...@hotmail.com> wrote:
> I'm using fminsearch to find the optimum variable values that give a minimum in my error function. My variables currently have different ranges. For example, some are between 0 and 1 and some are between 100 and 1000. Would the fminsearch function work better if I normalize all my variables so that they're in the same range or doesn't it matter? Thanks.

Subject: fminsearch and normalization

From: Dmitrey

Date: 27 Mar, 2007 08:20:19

Message: 2 of 3

What are the problems for testing it by yourself? You could already
had tried it many times.

let for example scf=[0.1 1 100 0.1] (you can just set it to your x0 or
typicalX; if zeros are present in x0 - replace them to for example
min(coords of x0 that are not equal to zero)), than try using
[x_ fval] = fminsearch(myobjfun2, x0 ./ scf);
x=x_ .* scf
------------
function r=myobjfun2(x)
global scf % or pass it as 2nd param of myobjfun2
x2=scf .* x
r= myobjfun(x)

btw openopt ralg enables all types of constraints and (sub)gradient
provided by user to objfun and/or constraints.

WBR, D.

On Mar 27, 11:34 am, Peter Bone <peterb...@hotmail.com> wrote:
> Thanks. I know that the fminsearch function doesn't scale the values automatically. My question is; will scaling them myself help the solver find the optimum solution?
> I have to use fminsearch by the way.

Subject: fminsearch and normalization

From: Dmitrey

Date: 27 Mar, 2007 08:25:27

Message: 3 of 3

sorry, in
myobjfun2
there should be of course
r= myobjfun(x2)
not
r= myobjfun(x)
D.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com