Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: fminunc stepsize

Subject: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 10:42:05

Message: 1 of 17

Hi,

I am using fminunc to minimize a two dimensional (x and y)
linear function.

My question is what stepize (i.e. unit vector) does fminunc
use when going away from the initial position that I give it?

Thanks in advance

Dan

Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 10:52:02

Message: 2 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69m9t$sif$1@fred.mathworks.com>...
> Hi,
>
> I am using fminunc to minimize a two dimensional (x and y)
> linear function.
>
> My question is what stepize (i.e. unit vector) does fminunc
> use when going away from the initial position that I give it?
>
> Thanks in advance
>
> Dan

You want to minimize a linear function using
an unconstrained optimizer? I'll save you the
effort.

[-inf,-inf]

Or possibly a +inf in there, depending on
some signs. Whats the point? Why do you care
how quickly you get to infinity? It will take a
long time, regardless of the step size.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 11:19:05

Message: 3 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69msi$3qi$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69m9t$sif$1@fred.mathworks.com>...
> > Hi,
> >
> > I am using fminunc to minimize a two dimensional (x and y)
> > linear function.
> >
> > My question is what stepize (i.e. unit vector) does fminunc
> > use when going away from the initial position that I
give it?
> >
> > Thanks in advance
> >
> > Dan
>
> You want to minimize a linear function using
> an unconstrained optimizer? I'll save you the
> effort.
>
> [-inf,-inf]
>
> Or possibly a +inf in there, depending on
> some signs. Whats the point? Why do you care
> how quickly you get to infinity? It will take a
> long time, regardless of the step size.
>
> John


The minimisation works fine, it actually only requires
around 20 iterations to find the minimum of the function.

The problem is this function is at a minimum at a certain x
and y value and I want to find them.


Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 11:29:03

Message: 4 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69of9$gkd$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in
> message <g69msi$3qi$1@fred.mathworks.com>...
> > "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> > <g69m9t$sif$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > I am using fminunc to minimize a two dimensional (x and y)
> > > linear function.
> > >
> > > My question is what stepize (i.e. unit vector) does fminunc
> > > use when going away from the initial position that I
> give it?
> > >
> > > Thanks in advance
> > >
> > > Dan
> >
> > You want to minimize a linear function using
> > an unconstrained optimizer? I'll save you the
> > effort.
> >
> > [-inf,-inf]
> >
> > Or possibly a +inf in there, depending on
> > some signs. Whats the point? Why do you care
> > how quickly you get to infinity? It will take a
> > long time, regardless of the step size.
> >
> > John
>
>
> The minimisation works fine, it actually only requires
> around 20 iterations to find the minimum of the function.
>
> The problem is this function is at a minimum at a certain x
> and y value and I want to find them.

I don't think you understand. A linear function
is unbounded. IT HAS NO MINIMUM.

So is your function not truly linear?

By the way, you cannot set the step size for
fminunc anyway.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 11:35:03

Message: 5 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69p1v$lee$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69of9$gkd$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in
> > message <g69msi$3qi$1@fred.mathworks.com>...
> > > "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in
message
> > > <g69m9t$sif$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I am using fminunc to minimize a two dimensional (x
and y)
> > > > linear function.
> > > >
> > > > My question is what stepize (i.e. unit vector) does
fminunc
> > > > use when going away from the initial position that I
> > give it?
> > > >
> > > > Thanks in advance
> > > >
> > > > Dan
> > >
> > > You want to minimize a linear function using
> > > an unconstrained optimizer? I'll save you the
> > > effort.
> > >
> > > [-inf,-inf]
> > >
> > > Or possibly a +inf in there, depending on
> > > some signs. Whats the point? Why do you care
> > > how quickly you get to infinity? It will take a
> > > long time, regardless of the step size.
> > >
> > > John
> >
> >
> > The minimisation works fine, it actually only requires
> > around 20 iterations to find the minimum of the function.
> >
> > The problem is this function is at a minimum at a certain x
> > and y value and I want to find them.
>
> I don't think you understand. A linear function
> is unbounded. IT HAS NO MINIMUM.
>
> So is your function not truly linear?
>
> By the way, you cannot set the step size for
> fminunc anyway.
>
> John

To be honest it's not truly linear, its affine i think.

My function is the logarithm of a Gaussian distribution.

I don't need to set the stepsize I was just wondering is
there a way to know what the step sizes are?

Thanks John for your reply

Subject: Re: fminunc stepsize

From: Bruno Luong

Date: 24 Jul, 2008 11:49:03

Message: 6 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69pd7$oj6$1@fred.mathworks.com>...

>
> To be honest it's not truly linear, its affine i think.
>
> My function is the logarithm of a Gaussian distribution.
>

Let me guess:

- What you do is a fit to data (transformed by log from a
Gaussian-like original data) by an affine function.

- This is *not* a minimization of the affine/linear
function, as you wrote at at the first post.

Bruno

Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 12:35:05

Message: 7 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69pd7$oj6$1@fred.mathworks.com>...
 
> To be honest it's not truly linear, its affine i think.

Let me guess that you are not minimizing
an affine function anyway. This would be a
mapping from one domain to another. As
such, it has no "minimum".

 
> My function is the logarithm of a Gaussian distribution.

The log of a gaussian "distribution"? I think
there may still be some confusion about
terminology.

Perhaps this is the negative log of a gaussian
likelihood function, or something like that,
used (a guess from your other comments) to
register two images.

 
> I don't need to set the stepsize I was just wondering is
> there a way to know what the step sizes are?

Do you want to know in advance or set in
advance the step size? No. Fminunc uses a
gradient based tool, that will determine the
step size it will use based on the shape of
your function.

I can't think of a way that fminunc will tell
you the step size (in the context of the large
or medium scale methods) it is currently
using either, at least not without use of the
debugger.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 12:59:05

Message: 8 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69stp$a8$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69pd7$oj6$1@fred.mathworks.com>...
>
> > To be honest it's not truly linear, its affine i think.
>
> Let me guess that you are not minimizing
> an affine function anyway. This would be a
> mapping from one domain to another. As
> such, it has no "minimum".
>
>
> > My function is the logarithm of a Gaussian distribution.
>
> The log of a gaussian "distribution"? I think
> there may still be some confusion about
> terminology.
>
> Perhaps this is the negative log of a gaussian
> likelihood function, or something like that,
> used (a guess from your other comments) to
> register two images.
>
>
> > I don't need to set the stepsize I was just wondering is
> > there a way to know what the step sizes are?
>
> Do you want to know in advance or set in
> advance the step size? No. Fminunc uses a
> gradient based tool, that will determine the
> step size it will use based on the shape of
> your function.
>
> I can't think of a way that fminunc will tell
> you the step size (in the context of the large
> or medium scale methods) it is currently
> using either, at least not without use of the
> debugger.
>
> John

You're right John it is the negative log of a gaussian
likelihood function.

> Do you want to know in advance or set in
> advance the step size? No. Fminunc uses a
> gradient based tool, that will determine the
> step size it will use based on the shape of
> your function.

No i don't need to set the step size I was just wondering if
there is a way of reporting upon the steps that fminunc
uses. I had forgotten that it uses a gradient based method

Thanks


Subject: Re: fminunc stepsize

From: Steven Lord

Date: 24 Jul, 2008 18:38:44

Message: 9 of 17


"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
news:g69uap$ivo$1@fred.mathworks.com...

*snip*

> No i don't need to set the step size I was just wondering if
> there is a way of reporting upon the steps that fminunc
> uses. I had forgotten that it uses a gradient based method

That's a different question than the one you asked first. If you want to
see what FMINUNC is doing as it processes your problem, use an OutputFcn.
Scroll down to the Options section of the reference page for FMINUNC for
more information on the OutputFcn option.

http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fminunc.html

--
Steve Lord
slord@mathworks.com


Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 10:52:02

Message: 10 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69m9t$sif$1@fred.mathworks.com>...
> Hi,
>
> I am using fminunc to minimize a two dimensional (x and y)
> linear function.
>
> My question is what stepize (i.e. unit vector) does fminunc
> use when going away from the initial position that I give it?
>
> Thanks in advance
>
> Dan

You want to minimize a linear function using
an unconstrained optimizer? I'll save you the
effort.

[-inf,-inf]

Or possibly a +inf in there, depending on
some signs. Whats the point? Why do you care
how quickly you get to infinity? It will take a
long time, regardless of the step size.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 11:19:05

Message: 11 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69msi$3qi$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69m9t$sif$1@fred.mathworks.com>...
> > Hi,
> >
> > I am using fminunc to minimize a two dimensional (x and y)
> > linear function.
> >
> > My question is what stepize (i.e. unit vector) does fminunc
> > use when going away from the initial position that I
give it?
> >
> > Thanks in advance
> >
> > Dan
>
> You want to minimize a linear function using
> an unconstrained optimizer? I'll save you the
> effort.
>
> [-inf,-inf]
>
> Or possibly a +inf in there, depending on
> some signs. Whats the point? Why do you care
> how quickly you get to infinity? It will take a
> long time, regardless of the step size.
>
> John


The minimisation works fine, it actually only requires
around 20 iterations to find the minimum of the function.

The problem is this function is at a minimum at a certain x
and y value and I want to find them.


Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 11:29:03

Message: 12 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69of9$gkd$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in
> message <g69msi$3qi$1@fred.mathworks.com>...
> > "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> > <g69m9t$sif$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > I am using fminunc to minimize a two dimensional (x and y)
> > > linear function.
> > >
> > > My question is what stepize (i.e. unit vector) does fminunc
> > > use when going away from the initial position that I
> give it?
> > >
> > > Thanks in advance
> > >
> > > Dan
> >
> > You want to minimize a linear function using
> > an unconstrained optimizer? I'll save you the
> > effort.
> >
> > [-inf,-inf]
> >
> > Or possibly a +inf in there, depending on
> > some signs. Whats the point? Why do you care
> > how quickly you get to infinity? It will take a
> > long time, regardless of the step size.
> >
> > John
>
>
> The minimisation works fine, it actually only requires
> around 20 iterations to find the minimum of the function.
>
> The problem is this function is at a minimum at a certain x
> and y value and I want to find them.

I don't think you understand. A linear function
is unbounded. IT HAS NO MINIMUM.

So is your function not truly linear?

By the way, you cannot set the step size for
fminunc anyway.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 11:35:03

Message: 13 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69p1v$lee$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69of9$gkd$1@fred.mathworks.com>...
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in
> > message <g69msi$3qi$1@fred.mathworks.com>...
> > > "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in
message
> > > <g69m9t$sif$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I am using fminunc to minimize a two dimensional (x
and y)
> > > > linear function.
> > > >
> > > > My question is what stepize (i.e. unit vector) does
fminunc
> > > > use when going away from the initial position that I
> > give it?
> > > >
> > > > Thanks in advance
> > > >
> > > > Dan
> > >
> > > You want to minimize a linear function using
> > > an unconstrained optimizer? I'll save you the
> > > effort.
> > >
> > > [-inf,-inf]
> > >
> > > Or possibly a +inf in there, depending on
> > > some signs. Whats the point? Why do you care
> > > how quickly you get to infinity? It will take a
> > > long time, regardless of the step size.
> > >
> > > John
> >
> >
> > The minimisation works fine, it actually only requires
> > around 20 iterations to find the minimum of the function.
> >
> > The problem is this function is at a minimum at a certain x
> > and y value and I want to find them.
>
> I don't think you understand. A linear function
> is unbounded. IT HAS NO MINIMUM.
>
> So is your function not truly linear?
>
> By the way, you cannot set the step size for
> fminunc anyway.
>
> John

To be honest it's not truly linear, its affine i think.

My function is the logarithm of a Gaussian distribution.

I don't need to set the stepsize I was just wondering is
there a way to know what the step sizes are?

Thanks John for your reply

Subject: Re: fminunc stepsize

From: Bruno Luong

Date: 24 Jul, 2008 11:49:03

Message: 14 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69pd7$oj6$1@fred.mathworks.com>...

>
> To be honest it's not truly linear, its affine i think.
>
> My function is the logarithm of a Gaussian distribution.
>

Let me guess:

- What you do is a fit to data (transformed by log from a
Gaussian-like original data) by an affine function.

- This is *not* a minimization of the affine/linear
function, as you wrote at at the first post.

Bruno

Subject: Re: fminunc stepsize

From: John D'Errico

Date: 24 Jul, 2008 12:35:05

Message: 15 of 17

"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
<g69pd7$oj6$1@fred.mathworks.com>...
 
> To be honest it's not truly linear, its affine i think.

Let me guess that you are not minimizing
an affine function anyway. This would be a
mapping from one domain to another. As
such, it has no "minimum".

 
> My function is the logarithm of a Gaussian distribution.

The log of a gaussian "distribution"? I think
there may still be some confusion about
terminology.

Perhaps this is the negative log of a gaussian
likelihood function, or something like that,
used (a guess from your other comments) to
register two images.

 
> I don't need to set the stepsize I was just wondering is
> there a way to know what the step sizes are?

Do you want to know in advance or set in
advance the step size? No. Fminunc uses a
gradient based tool, that will determine the
step size it will use based on the shape of
your function.

I can't think of a way that fminunc will tell
you the step size (in the context of the large
or medium scale methods) it is currently
using either, at least not without use of the
debugger.

John

Subject: Re: fminunc stepsize

From: Daniel Burke

Date: 24 Jul, 2008 12:59:05

Message: 16 of 17

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g69stp$a8$1@fred.mathworks.com>...
> "Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
> <g69pd7$oj6$1@fred.mathworks.com>...
>
> > To be honest it's not truly linear, its affine i think.
>
> Let me guess that you are not minimizing
> an affine function anyway. This would be a
> mapping from one domain to another. As
> such, it has no "minimum".
>
>
> > My function is the logarithm of a Gaussian distribution.
>
> The log of a gaussian "distribution"? I think
> there may still be some confusion about
> terminology.
>
> Perhaps this is the negative log of a gaussian
> likelihood function, or something like that,
> used (a guess from your other comments) to
> register two images.
>
>
> > I don't need to set the stepsize I was just wondering is
> > there a way to know what the step sizes are?
>
> Do you want to know in advance or set in
> advance the step size? No. Fminunc uses a
> gradient based tool, that will determine the
> step size it will use based on the shape of
> your function.
>
> I can't think of a way that fminunc will tell
> you the step size (in the context of the large
> or medium scale methods) it is currently
> using either, at least not without use of the
> debugger.
>
> John

You're right John it is the negative log of a gaussian
likelihood function.

> Do you want to know in advance or set in
> advance the step size? No. Fminunc uses a
> gradient based tool, that will determine the
> step size it will use based on the shape of
> your function.

No i don't need to set the step size I was just wondering if
there is a way of reporting upon the steps that fminunc
uses. I had forgotten that it uses a gradient based method

Thanks


Subject: Re: fminunc stepsize

From: Steven Lord

Date: 24 Jul, 2008 18:38:44

Message: 17 of 17


"Daniel Burke" <daniel.burke@nuigalway.ie> wrote in message
news:g69uap$ivo$1@fred.mathworks.com...

*snip*

> No i don't need to set the step size I was just wondering if
> there is a way of reporting upon the steps that fminunc
> uses. I had forgotten that it uses a gradient based method

That's a different question than the one you asked first. If you want to
see what FMINUNC is doing as it processes your problem, use an OutputFcn.
Scroll down to the Options section of the reference page for FMINUNC for
more information on the OutputFcn option.

http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fminunc.html

--
Steve Lord
slord@mathworks.com


Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
minimisation Daniel Burke 24 Jul, 2008 06:45:07
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics