search for: returnobject

Displaying 20 results from an estimated 20 matches for "returnobject".

2004 Jul 26
0
Problem with a while loop embedded in a function.
...xample, the parameters are fine. The result should be a list of the nlme object and 'OK' (which should be 5 for the example). I'm using R version 1.9.1 on Windows XP. Thanks for any thoughts, Ken ################ library(nlme) data(Loblolly) maxIter <- c(1, 1, 1, 1, 1) returnObject <- c(FALSE, FALSE, FALSE, FALSE, TRUE) nlsList.Object <- nlsList(SSasymp, Loblolly) M1 <- function(maxIter, returnObject) { ok <- FALSE OK <- 0 while(ok==FALSE) { OK <- OK + 1 nlme.control.parms <- list("maxIter"=maxIter[OK], "returnObje...
2006 May 26
2
lme, best model without convergence
...readers, I am fitting mixed models with the lme function of the nlme package. If I get convergence depends on how the method (ML/REM) and which (and how much) parameters will depend randomly on the cluster-variable. How get the bist fit without convergence? I set the parameters msVerbose and returnObject to TRUE: lmeControl(maxIter=50000, msMaxIter=200, tolerance=1e-4, niter=50, msTol=1e-5, nlmStepMax=500, ,msVerbose=TRUE ,returnObject=TRUE ) However, the lme-functions does not produce verbose output, nor does it return the best fit if lme is not converging. It returns only an error: Error...
2004 Aug 02
0
Returning singular nlme objects.
...an error such as "Error in solve.default(pdMatrix(a, fact = TRUE)) : system is computationally singular" or "Error in MEestimate(nlmeSt, grpShrunk) : Singularity in backsolve at level 0, block 1\n" be returned rather than only an error message being returned? Setting the "returnObject" nlme control option to TRUE seems to return an nlme object only when the maximum number of iterations is reached without meeting the convergence criterion. However, when in the estimation stage a matrix becomes singular, the returnObject option does not return the nlme object up to that point...
2006 Aug 04
1
gnlsControl
...has an idea on what parameters in gnlsControl to change to get convergence. Cheers Dan Coleman Genentech Inc. > gnlsControl function (maxIter = 50, nlsMaxIter = 7, msMaxIter = 50, minScale = 0.001, tolerance = 1e-06, nlsTol = 0.001, msTol = 1e-07, msScale = lmeScale, returnObject = FALSE, msVerbose = FALSE, apVar = TRUE, .relStep = (.Machine$double.eps)^(1/3), nlmStepMax = 100, opt = c("nlminb", "optim"), optimMethod = "BFGS", minAbsParApVar = 0.05) { list(maxIter = maxIter, nlsMaxIter = nlsMaxIter, msMaxIter = msMaxIter,...
2003 Sep 16
2
gnls( ) question
...ing message: Step halving factor reduced below minimum in NLS step in: gnls(model = y ~ 5 + ...)" mean? I have tried to address this by specifying "control = list(maxIter = 1000, pnlsMaxIter = 200, msMaxIter = 1000, tolerance = 1e-06, pnlsTol = 1e-04, msTol = 1e-07, minScale = 1e-10, returnObject = TRUE)" in my model calls, but this does not entirely eliminate the problem (I am running gnls( ) 24 separate times on separate data sets). Much thanks in advance, david paul #Constructing Indicator Variables indicator <- paste( "foo$X <- sapply(foo$subject.id, FUN = func...
2008 Jun 14
1
"False convergence" in LME
I tried to use LME (on a fairly large dataset, so I am not including it), and I got this error message: Error in lme.formula(formula(paste(c(toString(TargetName), "as.factor(nodeInd)"), : nlminb problem, convergence error code = 1 message = false convergence (8) Is there any way to get more information or to get the potentially wrong estimates from LME? (Also, the page in the
2007 Nov 01
1
A question about lme object
I have a question about the lme function in R. My question is: After I got the object from function lme, why the numIter value of the object is always NULL? Following is my code: jjww<-lme(y~x*zz,data=simul,random=~x|group, control=lmeControl(returnObject=TRUE)) attributes(jjww) jjww$numIter the first 20 observation of data simul are: > simul y x zz group 1 1.20722846 0.173024384 0.13729258 1 2 1.44590474 -0.811427991 0.13729258 1 3 0.18967259 -1.089059105 0.13729...
2012 Feb 05
1
Covariate model in nlme
...g nlme to fit a pharmacokinetic model. The base model is parameterized in terms of CL, V1, V2 and Q. basemodel<-nlme(Conc ~TwoCompModel(CL,Q,V1,V2,Time,ID), data = data2, fixed=list(CL+Q+V1+V2~1), random = pdDiag(CL+V1+V2~1), start=c(CL=log(20),Q=log(252),V1=log(24.9),V2=log(120)), control=list(returnObject=TRUE,msVerbose=TRUE, msMaxIter=20,pnlsMaxIter=20,pnlsTol=1), verbose=TRUE). Now, I want to include covariates (age and weight) in the base model. The relationships between CL and covariate is linear and given as the following equation. CL=TVCL+a*wt-b*age, where TVCL is mean clearance, a and b are...
2006 Jun 28
3
lme convergence
Dear R-Users, Is it possible to get the covariance matrix from an lme model that did not converge ? I am doing a simulation which entails fitting linear mixed models, using a "for loop". Within each loop, i generate a new data set and analyze it using a mixed model. The loop stops When the "lme function" does not converge for a simulated dataset. I want to
2003 Apr 19
1
nls, gnls, starting values, and covariance matrix
...to be able to fit the model using gnls. The format is a little different, but I get an error when I use the following syntax: gnls(Y~log(exp(a0-a1*X)+exp(b0-b1*X)),params=a0+a1+b0+b1~K,start=list(rep(c (6.02,0.2,4.5,0.001),16)),data=data.frame(Y=y,X=x,K=k),control=list (msVerbose=TRUE,apVar=FALSE,returnObject=TRUE)) Error in gnls(Y ~ log(exp(a0 - a1 * X) + exp(b0 - b1 * X)), params = a0 + : Approx. covariance matrix for parameter estimates not of full rank I assume that I'm getting the format of my starting values wrong. Any suggestions would be greatly appreciated. Best wishes Simon
2011 Jun 22
1
lme convergence failure within a loop
...may not be the best fit for every cell. I expect the optimization to fail in some places. I want to be able to detect when the algorithm has failed to converge automatically, so that I can continue my loop and record the places where the model does fit. I've used the lmeControl method with returnObject=TRUE options to allow me to continue looping, however I want to be able to flag the places where the convergence failed so that I can reject these gridcells and not mistakenly claim that the model fits at these points. Is there a way to do this? My example code shows the relevant lines of code-...
2001 Sep 07
3
fitting models with gnls
...dvised me on this matter. The problem was that using S-Plus he could fit the model and I, using R with the same commands, got an error message: > growth.gnls <- gnls(lt ~ Linf*(1-exp(-K*(age-t0))), + data=growth.dat, params= Linf +K + t0 ~ 1, start=list(Linf=500,K=0.2,t0=0), + control = list(returnObject = T), corr = corAR1(form=~fish|age)) Error in "[<-.factor"(*tmp*, , value = grpShrunk[revOrderShrunk]) : Argument "i" is missing, with no default If I use nls function I can estimate the parameters: > growth.nls <- nls(lt ~ Linf*(1-exp(-K*(age-t0))), + data...
2006 Feb 15
1
no convergence using lme
...thematically) I was wondering if anyone knew if there was anything else in the control values I should try changing. Below are the defaults.. lmeControl function (maxIter = 50, msMaxIter = 50, tolerance = 1e-06, niterEM = 25, msTol = 1e-07, msScale = lmeScale, msVerbose = FALSE, returnObject = FALSE, gradHess = TRUE, apVar = TRUE, .relStep = (.Machine$double.eps)^(1/3), minAbsParApVar = 0.05, nlmStepMax = 100, optimMethod = "BFGS", natural = TRUE) I was reading on the R listserve that lmer from the lme4 package may be preferable to lme (for convergence pro...
2001 Dec 03
0
problems with nmle
...is calculated with a formula somewhat different from the one given in the text, because that gives convergence problems: fm1Indom.nlme <- nlme(fm1Indom.lis, random=pdDiag(A1+lrc1+A2+lrc2 ~ 1) , control=list(msMaxIter=1000, msVerbose=TRUE,niterEM=100, returnObject=TRUE)) The algorithm says it has not converged, although the tracing output multiple times indicate that the current solution is probably a solution. The summary of the obtained object is very close to that given in the book. Kjetil Halvorsen -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-....
2003 Feb 04
0
Help with NLME
...lcp ~ 1 | bench/line, start = list(fixed=c(17.4305, 0.182444, 0.00928341, -0.00057221, 44.8384, 8.67678)), method="ML", verbose=T, control = nlmeControl(maxIter=250, msMaxIter=200, pnlsMaxIter=20, gradHess=TRUE, returnObject=TRUE, niterEM=100)) What I'd like to do is to compare reduced models with something like random = list(a.max ~ 1 | bench, a.qe + lcp ~ 1 | bench/line) i.e., to drop the nested term on each of the coefficients one by one so that I can do and anova() to compare the models. rando...
2007 Nov 01
0
Question about lme object
Hi, I have a question about the lme function in R. My question is: After I got the object from function lme, why the numIter value of the object is always NULL? Following is my code: jjww<-lme(y~x*zz,data=simul,random=~x|group, control=lmeControl(returnObject=TRUE)) attributes(jjww) jjww$numIter the first 20 observation of data simul are: > simul y x zz group 1 1.20722846 0.173024384 0.13729258 1 2 1.44590474 -0.811427991 0.13729258 1 3 0.18967259 -1.089059105 0.13729...
2009 Jan 22
1
convergence problem gamm / lme
...) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in MEestimate(lmeSt, grps) : NA/NaN/Inf in foreign function call (arg 1) > gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr=~1),family="poisson", niterPQL=200, control=lmeControl(returnObject=T)) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in MEestimate(lmeSt, grps) : Singularity in backsolve at level 0, block 1 In addition: Warning messages: 1: In logLik.reStruct(object, conLin) : Singular precision matrix in level -1, block 1 2: In logLik.reStruc...
2001 Jun 01
1
nls works but not gnls
This works fine: fit42<-nls(Vfs~SSlogis(Months,Asym.Int+Asym.Group*Groupdum,xmid,scal), data=df, start=c(Asym.Int=22,Asym.Group=5,xmid=2,scal=6), na.action=na.omit) But this, identical except using gnls, doesn't converge: fit43<-gnls(Vfs~SSlogis(Months,Asym.Int+Asym.Group*Groupdum,xmid,scal), data=df, start=c(Asym.Int=22,Asym.Group=5,xmid=2,scal=6), na.action=na.omit) Error in gnls(Vfs
2008 Jul 30
1
model mix problem. FALSE CONVERGENCE
Hi R users I try to use the lme but I can?t!!!!! My script is (some words in french, sorry!!): rm(list=ls(all=TRUE)) #Efface tous les objets en m?moire pour ?viter des erreurs library(MASS) #Chargement des Librairies library(car) library(Hmisc) library(tkWidgets) library(svDialogs) library(multtest) library(nlme) #Rep <- "C:/Documents and Settings/U3M/Bureau/steph/Scripts
2009 Jan 28
2
t.test in a loop
Hi All, I've been having a little trouble with creating a loop that will run a a series of t.tests for inspection, Below is the code i've tried, and some checks i've looked at. I've used the get(paste()) idea as i was told previously that the use of the eval should try and be avoided. I've run a single syntax to check that my systax is correct and works without any problems