Troy Robertson
2010-Oct-13 05:39 UTC
[Rd] Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
Hi all,
When upgrading to 2.11.1 recently I noticed different results being produced by
my code.
After much digging I have finally narrowed it to a call to nlm().
This can be replicated by:
FixedRemovals<-1836180125888
AbStageInitial<-2223033830403
Rates<- 0.3102445
nlm(function(rootM,Abund,Loss,OtherM)
{(Loss-(rootM/(rootM+OtherM)*
(1-exp(-(rootM+OtherM)))*
Abund))^2}
,0.001,print.level=0,fscale=0, gradtol=1E-10, stepmax = 100.0
,Loss=FixedRemovals
,Abund=AbStageInitial
,OtherM=Rates)$estimate
___________________________________________________________________________
Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not
the
intended recipient, you are notified that use or dissemination of this
communication is
strictly prohibited by Commonwealth law. If you have received this transmission
in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209
and
DELETE the message.
Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
[[alternative HTML version deleted]]
Troy Robertson
2010-Oct-13 05:51 UTC
[Rd] Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
Hi all,
When upgrading to 2.11.1 recently I noticed different results being produced by
my code.
After MUCH digging into my code I have finally narrowed it to a call to nlm().
The problem actually occurs in 2.10.1 and 2.12.0.
This can be replicated by trying the code below in some different versions of R:
FixedRemovals<-1836180125888
AbStageInitial<-2223033830403
Rates<- 0.3102445
myfunc<-function(rootM,Abund,Loss,OtherM)
{(Loss-(rootM/(rootM+OtherM)*
(1-exp(-(rootM+OtherM)))*
Abund))^2}
nlm(myfunc
,0.001,print.level=0,fscale=0, gradtol=1E-10, stepmax = 100.0
,Loss=FixedRemovals
,Abund=AbStageInitial
,OtherM=Rates)
nlm(myfunc
,0.001,print.level=0,fscale=0, gradtol=1E-10, stepmax = 100.0
,Loss=FixedRemovals
,Abund=AbStageInitial
,OtherM=Rates)$estimate
Why would I be seeing a different value of 'estimate' (or any of the
other returned list items)?
Originally I thought it was 2.11.1 that was giving me the grief with different
output but now I see that in 2.11.1 I get the same value to each returned list
item both ways.
Can anyone explain this?
Thanks
Troy
___________________________________________________________________________
Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not
the
intended recipient, you are notified that use or dissemination of this
communication is
strictly prohibited by Commonwealth law. If you have received this transmission
in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209
and
DELETE the message.
Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
Maybe Matching Threads
- nlm and optional arguments
- Viewing source code for .Internal functions
- Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
- Autocreate plugin
- *** caught segfault *** address 0x18, cause 'memory not mapped'