iteration history

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

iteration history

robert-mcfadden
Dear R Users
I would like to use optim function to optimize a function. I read help but I
couldn't find what I need: is it possible to get information after each
iteration, for example as there is in MATLAB:
                                                        Gradient's
 Iteration  Func-count       f(x)        Step-size      infinity-norm
     0          24          388.976                            14
     1          72           385.67      0.0292637           16.8  
     2          96           383.54              1           4.15  
     3         120          383.412              1          0.108  
     4         144          383.412              1          0.002  
     5         168          383.412              1        0.00149  
     6         192          383.412              1      6.23e-005  
     7         216          383.412              1      1.01e-005  
   

It is useful when iteration takes long time - I know what's happen
I would appreciate any suggestion

Robert

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: iteration history

Gabor Grothendieck
Check out:

https://www.stat.math.ethz.ch/pipermail/r-devel/2006-January/036034.html

On 2/6/06, Robert Mcfadden <[hidden email]> wrote:

> Dear R Users
> I would like to use optim function to optimize a function. I read help but I
> couldn't find what I need: is it possible to get information after each
> iteration, for example as there is in MATLAB:
>                                                        Gradient's
>  Iteration  Func-count       f(x)        Step-size      infinity-norm
>     0          24          388.976                            14
>     1          72           385.67      0.0292637           16.8
>     2          96           383.54              1           4.15
>     3         120          383.412              1          0.108
>     4         144          383.412              1          0.002
>     5         168          383.412              1        0.00149
>     6         192          383.412              1      6.23e-005
>     7         216          383.412              1      1.01e-005
>
>
> It is useful when iteration takes long time - I know what's happen
> I would appreciate any suggestion
>
> Robert
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: iteration history

Marco Geraci
In reply to this post by robert-mcfadden
Hi, I never used the function 'optim' so I took a look
at ?optim.
you'll find the following

The 'control' argument is a list that can supply any
of the following components:
     'trace' Non-negative integer. If positive,
tracing information on the progress of the
optimization is produced. Higher values may produce
more tracing information: for method '"L-BFGS-B"'
there are six levels of tracing

so the usage for 'trace' is
> optim(..., control=list(trace = k))
where k is >= 0.
You might want to "play" with different methods and
values for 'trace' and see if you can get what you
want.

hope this helps,

Marco Geraci

--- Robert Mcfadden <[hidden email]> wrote:

> Dear R Users
> I would like to use optim function to optimize a
> function. I read help but I
> couldn't find what I need: is it possible to get
> information after each
> iteration, for example as there is in MATLAB:
>                                                    
>    Gradient's
>  Iteration  Func-count       f(x)        Step-size  
>    infinity-norm
>      0          24          388.976                
>           14
>      1          72           385.67      0.0292637  
>         16.8  
>      2          96           383.54              1  
>         4.15  
>      3         120          383.412              1  
>        0.108  
>      4         144          383.412              1  
>        0.002  
>      5         168          383.412              1  
>      0.00149  
>      6         192          383.412              1  
>    6.23e-005  
>      7         216          383.412              1  
>    1.01e-005  
>    
>
> It is useful when iteration takes long time - I know
> what's happen
> I would appreciate any suggestion
>
> Robert
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: iteration history

justin bem
In reply to this post by robert-mcfadden
Hi Bob !

It possible See the first element of controle argument
set it to a positive integer !



--- Robert Mcfadden <[hidden email]> a écrit :

> Dear R Users
> I would like to use optim function to optimize a
> function. I read help but I
> couldn't find what I need: is it possible to get
> information after each
> iteration, for example as there is in MATLAB:
>                                                    
>    Gradient's
>  Iteration  Func-count       f(x)        Step-size  
>    infinity-norm
>      0          24          388.976                
>           14
>      1          72           385.67      0.0292637  
>         16.8  
>      2          96           383.54              1  
>         4.15  
>      3         120          383.412              1  
>        0.108  
>      4         144          383.412              1  
>        0.002  
>      5         168          383.412              1  
>      0.00149  
>      6         192          383.412              1  
>    6.23e-005  
>      7         216          383.412              1  
>    1.01e-005  
>    
>
> It is useful when iteration takes long time - I know
> what's happen
> I would appreciate any suggestion
>
> Robert
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html