[R] Optimisation does not optimise!

Prof J C Nash (U30A) nashjc at uottawa.ca
Sat Jul 13 14:06:54 CEST 2013


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-request at r-project.org wrote:
> Date: Fri, 12 Jul 2013 21:22:00 +0100
> From: Stephen Clark<gysc at leeds.ac.uk>
> To:"r-help at R-project.org"  <r-help at R-project.org>
> Subject: [R] Optimisation does not optimise!
> Message-ID:
> 	<928C4F7877280844B906D12D63A3F15B01145E5B5C24 at 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?



More information about the R-help mailing list