search for: iterlim

Displaying 20 results from an estimated 26 matches for "iterlim".

Did you mean: iteri
2000 Mar 06
1
nlm and optional arguments
...his 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.analyticals) } As...
2011 Aug 24
1
problema de selección de valores iniciales en nlm
Hola a todos, Necesito estimar dos parametros utilizando la función nlm; fit<-nlm(hood2par,c(x01[i],x02[j]),iterlim=300, catch=x[,c(3,4,5)],sp=.5) donde hood2par es una logística modificada. Pero en mi caso, la convergencia de nlm depende de los valores iniciales de dichos parámetros. Para buscar dichos valores iniciales de manera automática, genero dos vectores de valores iniciales posibles, x01=seq(-10,-...
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...banana2 <- function(x){ b <- 100*(x[2]-x[1]^2)^2+(1-x[1])^2 attr(b, "gradient") <- Dbanana(x) attr(b, "hessian") <- D2banana(x) b } nlm(banana2, c(-1.2, 1)) # Found the valley but not the minimum # in the default 100 iterations. nlm(banana2, c(-1.2, 1), iterlim=10000) # found the minimum to 3 significant digits in 5017 iterations. nlminb(c(-1.2, 1), banana, Dbanana, D2banana) # took 95 iterations to find the answer to double precision. To understand this better, I wrote my own version of "nlm" (see below), and learned that the hessian is o...
2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
...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 problem): fn.2 &...
2011 Apr 10
0
maxLik package.
Dear Sir/ Madam,   I have some enquiry in R about maxLik package where, in this package we have the usage  maxLik(logLik, grad, hess, start, method, iterlim, print.level)   when I used this with print.level equals to 3 I could have estimates of parameters at each iteration but I do not know how can I call the information in the level. Is there any way can help me to call the information within the print. level argument?. Also when I changed the num...
2007 Apr 09
1
R:Maximum likelihood estimation using BHHH and BFGS
...r = Inf, control = list(), hessian = FALSE, ...) (c) > optim(c(c,1,0),fn, method="BFGS", control=list(c=c))* Error: argument "psi" is missing, with no default *(3a) maxBHHH{micEcon} (b) Usage: maxBHHH(fn, grad = NULL, hess=NULL, theta, print.level = 0, iterlim = 100, ...)* * * *(c) > maxBHHH(fn(c,psi,alpha),theta=list(psi=1,alpha=0))* Error in psi^(-1/alpha) * (lag(c[i], -1)) : time-series/vector length mismatch (4a) maxBFGS{micEcon} (b) Usage: maxBFGS(fn, grad = NULL, theta, print.level = 0, iterlim = 200, tol = 1e-06, .....
2010 Mar 25
1
*** caught segfault *** address 0x18, cause 'memory not mapped'
...ainsimbiasP" > > ptm<-proc.time() > sink("out22031001.txt") > > fmainsimbiasP(10000,100) proc.time()-ptm *** caught segfault *** address 0x18, cause 'memory not mapped' Traceback: 1: nlm(f = fprof_deriv, x = x, p = parHInt, b = parFIX, hessian = T, iterlim = 2000, check.analyticals = F, stepmax = 10) 2: doTryCatch(return(expr), name, parentenv, handler) 3: tryCatchOne(expr, names, parentenv, handlers[[1]]) 4: tryCatchList(expr, classes, parentenv, handlers) 5: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)...
2011 May 03
3
help with the maxBHHH routine
...he different methods (NR, BFGS, etc). I have figured out how to use all of them except the maxBHHH function. This one is different from the others as it requires an observation level gradient. I am using the following syntax: maxBHHH(logLik,grad=nuGradient,finalHessian="BHHH",start=prm,iterlim=2) where logLik is the likelihood function and returns a vector of observation level likelihoods and nuGradient is a function that returns a matrix with each row corresponding to a single observation and the columns corresponding to the gradient values for each parameter (as is mentioned in the on...
2008 Jan 15
1
Viewing source code for .Internal functions
...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.
2011 Apr 08
1
Estimates at each iteration
...step "E-step and M-step"and in this case I need to maximize the expected of like lihood function " which I get from E- step" and take those estimates of parameter to update the E-step and repate these till convargence has been met. So I need to know if I control the number of iterlim in maxLik or optim Package by puting this number equals to one to maximize M-step and getting  just the estimates of parameter for one iteration and hence use them to update the E-step and again maximaize M-step by using maxLik or optim by contoling the number of limiter and putting the number...
2007 Feb 17
1
Constraint maximum (likelihood) using nlm
...(( dat[i,1] - params[1])^2/ (params[2]^2 + dat[i,2]^2)) } ll <- -0.5 * llsum + constant return(-ll) } Using (find data attached): data.osl <- read.table("osl.dat",header=TRUE) data.matrix <- as.matrix(data.frame(data.osl$de,data.osl$se)) nlm(negll,c(0.75,0.5),dat=data.matrix,iterlim=200) I get estimates for mu and sigma of: 3.629998e+00 -4.975368e-07 However, sigma obviously has to be >= 0. Therefore I am trying to transform sigma: negll.trans <- function(params,...) { params[2] <- log(params[2]) negll(params,...) } where nlm(negll.trans,c(0.75,0.5),dat=data....
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
...imum=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 another software...
2008 Jun 16
1
Error in maximum likelihood estimation.
...--------------------------------------------- Applying nlm() function to the above function with the starting values gives the following error message. ------------------------------------------------ out <- nlm(mlog, theta.start, nx = 2 , nz = 2, dt = dat, print.level = 2, hessian\ = T, iterlim = 500) iteration = 0 Step: [1] 0 0 0 0 0 0 0 Parameter: [1] 0.0900 0.0080 0.0080 0.0230 0.0008 0.0080 0.0080 Function Value [1] 6116.2 Gradient: [1] -10704.8 -46465.7 -22536.4 47168.2 54542.9 -776512.5 579.9 Error in nlm(mlog, theta.start, nx = 2, nz = 2, dt = dat, print.level = 2,...
2009 May 16
1
maxLik pakage
...si)/(sqrt(omega^2+lambda2*(x-ksi)^2)) /(pnorm(lambda1*(x-ksi)/(sqrt(omega^2+lambda2*(x-ksi)^2))*sqrt((omega^2+lambda2*(x-ksi)^2)^3))))))) } n<- length(x) # the final command is : res<- maxLik(G2StNV178,grad=gradlik,start=c(4.666484 ,4603.399055 , 4603.399055   ,-0.016674 ,19.055865),tol=1e-16,iterlim =3000) summary(res) [[alternative HTML version deleted]]
2011 Nov 23
6
Incomplete final line (Antonio José Sáez)
...p0s<-p0[2] logL1<-function(p){ l1<-exp(p[1]) l2<-l1 s<-exp(p[2]) -(n.neg*log(l1)+n.pos*log(l2) -l1*sum(log(1-x.neg/s))-l2*sum(log(1+x.pos/s)) -sum(log(1+abs(x)/s)) -n*log(s)+n*log(0.5) ) } if (method==1){ p0<-c(log(p0l),log(p0s)) fit<-nlm(logL1,p=p0,hessian= TRUE,iterlim=iters,print.level=print.level) fit$value<-fit$minimum fit$par<-fit$estimate fit$convergence<-fit$code method="hessian nlm" l.est<-exp(fit$par[1]) s.est<-exp(fit$par[2]) } #Resultados resultados<-list( coefficients=c(l.est,s.est), se="Mejor por bootstrapi...
2004 Aug 21
0
Convergence code in nlm function
...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]]
2007 Mar 16
0
Segmentation fault in estimating structural equation models with the SEM package.
...get a segmentation fault in the sem routine and my program stops with the following error message: > *** caught segfault *** > address (nil), cause 'unknown' > > Traceback: > 1: nlm(if (analytic.gradient) objective.2 else objective.1, > start, hessian = TRUE, iterlim = maxiter, print.level = if > (debug) 2 else 0, typsize = typsize, . > ..) > 2: sem.default(ram = ram, S = S, N = N, param.names = pars, > var.names = vars, fixed.x = fixed.x, debug = debug, ...) > 3: sem(ram = ram, S = S, N = N, param.names = pars, var.names = > var...
2013 May 10
1
PGLM Package: Starting Values for Within-Model
...in panel regression. I am using the example data set from the PGLM package: library(pglm) data('Unions', package = 'pglm') anb <- pglm(union~wage+exper+rural, Unions, family=binomial('probit'), model="within", method = "bfgs", print.level=0, R = 5, iterlim=2) The pglm-function needs the argument start for starting values. What do I use? Thank you very much! -- View this message in context: http://r.789695.n4.nabble.com/PGLM-Package-Starting-Values-for-Within-Model-tp4666739.html Sent from the R help mailing list archive at Nabble.com.
2013 Apr 08
0
Maximum likelihood estimation of ARMA(1,1)-GARCH(1,1)
...a0=c(0, +0.78, -0.79, +0.0000018, +0.06, +0.93, 0.01) theta0=rep(0.01,6) negative_log_likelihood_arma11_garch11(theta=theta0, data=raw_data) alpha= proc.time() maximum_likelihood_fit_arma11_garch11= nlm(negative_log_likelihood_arma11_garch11, p=theta0, data=raw_data, hessian=TRUE, iterlim=500) #optim(theta0, # negative_log_likelihood_arma11_garch11, # data=raw_data, # method="L-BFGS-B", # upper=c(+0.999999999999,+0.999999999999,+0.999999999999,0.999999999999,0.999999999999,0.999999999999), # lower=c(-0.999999999999,-0.999999999999,-0.999999999999,0...
2011 Sep 05
3
function censReg in panel data setting
Hello all, I have a problem estimating Random Effects model using censReg function. small part of code: UpC <- censReg(Power ~ Windspeed, left = -Inf, right = 2000,data=PData_In,method="BHHH",nGHQ = 4) Error in maxNRCompute(fn = logLikAttr, fnOrig = fn, gradOrig = grad, hessOrig = hess, : NA in the initial gradient ...then I tried to set starting values myself and here is