search for: steptol

Displaying 10 results from an estimated 10 matches for "steptol".

2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
...: I have data on an absorption measurement which I want to fit with an voigt profile: fn.1 <- function(p){ for (i1 in ilong){ ff <- f[i1] ex[i1] <- exp(S*n*L*voigt(u,v,ff,p[1],p[2],p[3])[[1]]) } sum((t-ex)^2) } out <- nlm(fn.1, p = c(fo, GG, GL), hessian = TRUE, steptol = 1e-5, iterlim = 1000) foN <- out$estimate[1] GGN <- out$estimate[2] GLN <- out$estimate[3] This works fine but the my start value of S is to poor, so I like to fit S in a second run, with the initial values from the first run (two runs because I know that S as an parameter is an pr...
2000 Mar 06
1
nlm and optional arguments
...ut 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,gradtol=gradtol,stepmax=stepmax,steptol=steptol,iterlim=iterlim, check.analyticals=check.analyt...
1999 Mar 05
1
typos
R version: RW0632 1. gnlm package, nlr() error message: "Last global step failed to locate a point lower than x. Either x is an approximate local minimum of the function, the function is too non-linear for this algorithm, or steptl is too large." last line: steptol (also, should it read "steptol is too small?") 2. help(glm) " Fitting Generalized Linear Models glm(formula, family=gaussian, data, weightst=NULL, subsett=NULL," typos in "weights" and "subset" Thank you! Rashid Nassar -.-.-.-.-.-.-.-....
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...onverged 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^2)<(gradtol...
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.
2013 Jan 16
1
Help with a parallel process
...;- function(A) { A1=A[1] A2=A[2] A3=A[3] regm1 <- nnet(Xcc,Ycr,entropy=T,size=A1,decay=A2,maxit=2000,trace=F,Hess=T,rang=A3,skip=T) dif=sum((predict(regm1,Xcc)-Ycr)^2) return(dif) } somar=DEoptim(pred_regm1,c(1,0.00001,0.01), c(25,0.999,0.95), control = DEoptim.control(steptol=25,trace = FALSE,itermax=500,parallelType=1)) but implemented parallel process, i have next error: Error en checkForRemoteErrors(val) : 4 nodes produced errors; first error: could not find function "nnet" how I can solve my mistake? Thanks and kind regards -- David Zamora Ávila...
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
...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 has at its .975 # quantile a value of 4 (this has been verified in...
2001 Nov 25
2
another optimization question
Dear R list members, Since today seems to be the day for optimization questions, I have one that has been puzzling me: I've been doing some work on sem, my structural-equation modelling package. The models that the sem function in this package fits are essentially parametrizations of the multinormal distribution. The function uses optim and nlm sequentially to maximize a multinormal
2000 Dec 07
0
Tuning the nlm function
Hi Everyone, Is there a simple way to force nlm to take larger initial steps? Setting print.level = 2 allows me to inspect the step size at each iteration, but I appear not to have made any appreciable impact on it by changing values of typsize, fscale, steptol or stepmax. The steps repeatedly come out tiny, 1e-9 typically, and the algorithm is terminating not because the gradient is zero (it is not, according to the numerical values) but because the function value is not changing between iterations. Am I missing something obvious? Many thanks, Jonatha...
2004 Aug 21
0
Convergence code in nlm function
...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]]