Considering that I devised the code initially on a computer with only 8K bytes for program and data, and it appears that your problem has 10000 parameters, I'm surprised you got any output. I suspect the printout is the BUILD phase where each weight is being adjusted in turn by the same shift.

Don't try to move the Titanic on a pram.

If you work out a gradient function, you can likely use Rcgmin (even though I wrote original CG in optim(), not recommended). spg from BB may also work OK.

This problem is near linear, so there are other approaches.

JN


On 13-07-13 06:00 AM, r-help-requ...@r-project.org wrote:
Date: Fri, 12 Jul 2013 21:22:00 +0100
From: Stephen Clark<g...@leeds.ac.uk>
To:"r-help@R-project.org"  <r-help@R-project.org>
Subject: [R] Optimisation does not optimise!
Message-ID:
        <928c4f7877280844b906d12d63a3f15b01145e5b5...@hermes8.ds.leeds.ac.uk>
Content-Type: text/plain; charset="us-ascii"

Hello,

I have the following code and data. I am basically trying to select individuals 
in a sample (by setting some weights) to match known counts for a zone. This is 
been done by matching gender and age bands. I have tested the function to be 
optimised and it does behave as I would expect when the weights are changed. 
However when I run the optimisation I get the following output

>optout<-optim(weights0, func_opt, control=list(REPORT=1))
[1] 27164
[1] 27163.8
[1] 27163.8
[1] 27163.8
[1] 27163.8
[1] 27163.8
[1] 27163.8
[1] 27163.8
[1] 27163.8
etc

which suggest an initial change but thereafter the optimisation does not appear 
to adapt the weights at all. Can anyone see what this is happening and how to 
make the problem optimise?

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to