Displaying 7 results from an estimated 7 matches for "gradtol".
2000 Mar 06
1
nlm and optional arguments
...but defining a temporary function that passes the optional
arguments to the objective function), but I presume this would be cleaner
and faster if implemented at a lower level ...
nlm2 <- function(f, p, hessian=FALSE, typsize=rep(1,length(p)),
fscale=1, print.level=0, ndigit=12, gradtol=1e-6,
stepmax=max(1000 * sqrt(sum((p/typsize)^2)), 1000),
steptol=1e-6, iterlim=100, check.analyticals=TRUE, ...) {
tmpf <- function(x) {
f(x,...)
}
nlm(tmpf,p,hessian=hessian,typsize=typsize,fscale=fscale,print.level=print.level,
ndigit=ndigit,gra...
2010 Oct 13
1
Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
...owed 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 addres...
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...ill had
not converged after 100 iterations.
What might be done to improve the performance of something like "nlm"
without substantially increasing the overhead for other problems?
Thanks.
spencer graves
#############################
nlm. <- function(f=fgh, p=c(-1.2, 1),
gradtol=1e-6, steptol=1e-6, iterlim=100){
# R code version of "nlm"
# requiring analytic gradient and hessian
#
# Initial evaluation
f.i <- f(p)
f0 <- f.i+1
# Iterate
for(i in 1:iterlim){
df <- attr(f.i, "gradient")
# Gradient sufficiently small?
if(sum(df^...
2008 Jan 15
1
Viewing source code for .Internal functions
I am trying to view the source code of the function nlm in the stats
package of R 2.4.1.
I downloaded the source from CRAN and opened nlm.R, and it calls a
.Internal function:
.Internal(nlm(function(x) f(x, ...), p, hessian, typsize, fscale,
msg, ndigit, gradtol, stepmax, steptol, iterlim))
This is the same thing I saw when entering the function name at the R
command prompt. Where will I find the actual code?
Thanks.
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
...task with a different R function.
optimize(f=Low.Lim.NC.F, lower=LL.0, upper=50, maximum=FALSE, tol=tol,
alpha.lower=alpha.lower, F.value=F.value, df.1=df.1, df.2=df.2)
# Try to accomplish the same task with a different R function.
nlm(f=Low.Lim.NC.F, p=LL.0, fscale=1,
print.level = 0, ndigit=12, gradtol = 1e-6,
stepmax = max(1000 * sqrt(sum((LL.0/10)^2)), 1000),
steptol = 1e-6, iterlim = 1000, check.analyticals = TRUE,
alpha.lower=alpha.lower, F.value=F.value, df.1=df.1, df.2=df.2)
# The answer in each case is 3.0725. Thus, a noncentral F with
# 5 and 200 df with a noncentrality parameter 3.0725...
2007 Jun 27
1
SEM model fit
...ct, theta15, 0.5
con -> prev, gam5, 0.8
prev -> enf, gam6, 0.4
sem.enf.rq <- sem(ram = mdl.rq, S = hcor(dx), N = nrow(dx), obs.v =
names(dx), raw = F, fixed = names(dx)[4:6], par.size = 's', maxiter = 1e3,
analytic = F, gradtol = 1e-10) ##set raw to False
summary(obj = sem.enf.rq, dig = 3, conf = 0.9)
Respectfully,
Frank Lawrence
2004 Aug 21
0
Convergence code in nlm function
...st of cases. I tried to change the optional parameters in the nlm call but this does not help to achieve code=1. What may be a reason for such situation? Could I think that the obtained estimates are what I am looking for?
I am using R 1.9.1:
nlm(N.Loglik,initial.values,fscale=1,print.level = 1, gradtol = 1e-6,steptol = 1e-6,iterlim = 500,y=y)
Much thanks,
Victoria.
[[alternative HTML version deleted]]