search for: xmid

Displaying 20 results from an estimated 99 matches for "xmid".

Did you mean: mid
2004 Aug 16
2
using nls to fit a four parameter logistic model
...781.000 13256 7 391.000 7255 8 195.000 3049 9 97.700 1849 10 48.400 743 11 24.000 480 12 12.000 255 13 6.000 241 14 3.000 128 15 1.500 103 16 0.001 50 I am able to fit the above data to the equation > nls(log(il10)~A+(B-A)/(1+exp((xmid-log(conc))/scal)),data=test, + start = list(A=log(0.001), B=log(100000), + xmid=log(6000),scal=0.8)) Nonlinear regression model model: log(il10) ~ A + (B - A)/(1 + exp((xmid - log(conc))/scal)) data: test A B xmid scal 3.796457 14.705159 6.410144 2.507653 resid...
2001 Oct 07
1
Bug in Deriv? (PR#1119)
..., it is the same for all versions. _ platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 3.0 year 2001 month 06 day 22 language R ----------------------------------------------------------------- > deriv(~offv+Asym/(1+exp(-(x-xmid)/scal)),"x") expression({ .expr4 <- exp(-x - xmid/scal) #### Wrong !!!! > deriv(~offv+Asym/(1+exp(-x/scal+xmid/scal)),"x") expression({ .expr5 <- exp(-x/scal + xmid/scal) ## Correct > deriv(~offv+Asym/(1+exp((xmid-x)/scal)),"x") expression({...
2011 Nov 17
3
Obtaining a derivative of nls() SSlogis function
Hello, I am wondering if someone can help me. I have the following function that I derived using nls() SSlogis. I would like to find its derivative. I thought I had done this using deriv(), but for some reason this isn't working out for me. Here is the function: asym <- 84.951 xmid <- 66.90742 scal <- -6.3 x.seq <- seq(1, 153,, 153) nls.fn <- asym/((1+exp((xmid-x.seq)/scal))) try #1 deriv(nls.fn) #get an Error in .Internal(deriv.default(expr, namevec, function.arg, tag, hessian)) : 'namevec' is missing try #2 deriv(nls.fn, namevec=c("asym", &q...
2006 Jan 23
1
nlme in R v.2.2.1 and S-Plus v. 7.0
...rtheless, I wonder whether one program is more suited than the other to pursue my modeling. Below I included the input + output code, first for S-Plus, than for R. Many thanks and best regards, Paolo Ghisletta ############ #S-Plus #min=4, max=41 > logistic4.a <- nlme(jugs ~ 4 + 41 / (1 + xmid*exp( -scal*I(occ-1) + u)), fixed=scal+xmid~1, random= u~1 |id, start=c(scal=.2, xmid=155), data=jug, na.action=na.exclude, method="ML") > summary(logistic4.a) Nonlinear mixed-effects model fit by maximum likelihood Model: jugs ~ 4 + 41/(1 + xmid * exp( - scal * I(occ - 1) + u)) D...
2007 Oct 17
2
nmle: gnls freezes on difficult case
...10 day 03 svn rev 43063 language R version.string R version 2.6.0 (2007-10-03) start=c(-1.5, 9.5, 0.09, 10.25) names(start)<-c("A","B","xmid","scal") gnls(response~SSllogis(conc,A,B,xmid,scal),tdat,start=start,weights=varPower(),verbose=TRUE) **Iteration 1 GLS step: Objective: NULLvarStruct parameters: power 0.3373199 NLS step: RSS = 0 model parameters:-0.799941 8.99983 -0.522623 212.314 iterations: 2...
2011 Aug 09
1
nls, how to determine function?
...NA,0,0,0,NA,0.212454212,3.120181406,NA,0.011811024,NA,0,0.120430108,5.928571429,1.75,0.679292929,0.97,NA,0,NA,NA,1,0.38547486,NA,1.460732984,0.007795889,0.05465288,0.004341534) dat.df.1 <- data.frame(dat) dat.df.2 <- data.frame(x=x.seq, dat.df=dat.df.1) fit.dat <-nls(dat ~ SSlogis(x, Asym, xmid,scal), data = dat.df.2, start =list(Asym=90, xmid = 75, scal = -6)) plot(dat.df.2, axes=FALSE, ann=FALSE, ylim=c(0,100)) lines(dat.df.2$x[complete.cases(dat.df.2)], predict(fit.dat), ylim=c(0,100)) summary(fit.dat) ************************************************************************** Formula...
2004 May 18
0
nlme: Initial parameter estimates
...kelihood, AIC and also on the significance of some parameter). Below the fit of the same model for different values of initial parameters: 1- Initial parameters = c(3, 20, -3.732865) >summary(fm.nlme) Nonlinear mixed-effects model fit by maximum likelihood Model: MTL ~ SSlogis(age, Asym, xmid, scal) Data: data AIC BIC logLik 7.996858 33.22420 2.001571 Random effects: Formula: list(Asym ~ 1, xmid ~ 1) Level: optid Structure: Diagonal Asym xmid Residual StdDev: 0.2577518 0.004429942 0.1616483 Fixed effect...
2000 Oct 14
2
Access to calculations in nls
Hi, I would like to be able to access the calculated results from the nls package. Using the example in R, fm3DNase1 we can reurn certain parts of the calculations: > coef(fm3DNase1) Asym xmid scal 2.345179 1.483089 1.041454 > resid(fm3DNase1) [1] -0.0136806237 -0.0126806237 0.0089488569 0.0119488569 -0.0025803222 [6] 0.0064196778 0.0026723396 -0.0003276604 -0.0187778127 -0.0237778127 [11] 0.0381369952 0.0201369952 -0.0335131004 -0.0035131004 0.0150122651 [16] -0.00498...
2005 May 10
2
predict nlme syntax
....nlme. I would like to predict from nlme object for new data. I used predict(fit.nlme6, data=newdata) but I have always got fitted values, no matter how I changed newdata. I have > summary(fit.nlme6) Nonlinear mixed-effects model fit by maximum likelihood Model: konverze ~ SSfpl(tepl, A, B, xmid, scal) Data: limity.gr AIC BIC logLik 882.4939 907.6738 -433.2469 Random effects: Formula: list(xmid ~ 1, scal ~ 1) Level: spol.f Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr xmid 29.680114 xmid scal 6.481679 0.249 Re...
2006 May 17
1
nlme model specification
Hi folks, I am tearing my hair out on this one. I am using an example from Pinheiro and Bates. ### this works data(Orange) mod.lis <- nlsList(circumference ~ SSlogis(age, Asymp, xmid, scal), data=Orange ) ### This works mod <- nlme(circumference ~ SSlogis(age, Asymp, xmid, scal), data=Orange, fixed = Asymp + xmid + scal ~ 1, start = fixef(mod.lis) ) ### I try a slightly different model specification for the fixed effec...
2008 Jan 04
3
nls (with SSlogis model and upper limit) never returns (PR#10544)
...ion never finishes and locks R up: > values <- list(x=10:30, y=c(23.85, 28.805, 28.195, 26.23, 25.005, 20.475, 17.33, 14.97, 11.765, 8.857, 5.3725, 5.16, 4.2105, 2.929, 2.174, 1.25, 1.0255, 0.612, 0.556, 0.4025, 0.173)) > y.max <- max(values$y) > model <- nls(y ~ SSlogis(x, asym, xmid, scal), data=values, algorithm="port", start=c(asym=y.max, xmid=15, scal=-0.5), upper=c(y.max, Inf, Inf)) This used to work with R version 2.5.1 patched. The problem does _not_ occur if the parameter "scal=-0.5" in the nls call is changed, e. g. to "scal=-0.6" or &quo...
2018 May 05
0
Bug in profile.nls with algorithm = "plinear"
...atrix is supplied on the right hand side. Here is the bug and a potential fix ##### # example where profile.nls does not work with `plinear` but does with # `default` require(graphics) set.seed(1) DNase1 <- subset(DNase, Run == 1) x <- rnorm(nrow(DNase1)) f1 <- nls(density ~ b1/(1 + exp((xmid - log(conc))/scal)) + b2 / x, data = DNase1, start = list(xmid = 0, scal = 1, b1 = 1, b2 = 1)) coef (f1) #R> xmid scal b1 b2 #R> 1.5055308 1.0455951 2.3707962 0.0006887 confint(f1) #R> Waiting for profiling to be done... #R> 2.5% 97.5% #R&...
2001 May 01
0
SSfpl self-start sometimes fails... workaround proposed
Hello, nls library provides 6 self-starting models, among them: SSfp, a four parameters logistic function. Its self-starting procedure involves several steps. One of these steps is: pars <- as.vector(coef(nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data = xydata, start = list(lscal = 0), algorithm = "plinear"))) which assumes an initial value of lscal equal to 0. If lscal is very different to 0, the evaluation could fail (singular gradient,...), as it is the case with the dataset provided hereunder (see end of th...
2008 Apr 14
3
Logistic regression
Dear all, I am trying to fit a non linear regression model to time series data. If I do this: reg.logis = nls(myVar~SSlogis(myTime,Asym,xmid,scal)) I get this error message (translated to English from French): Erreur in nls(y ~ 1/(1 + exp((xmid - x)/scal)), data = xy, start = list(xmid = aux[1], : le pas 0.000488281 became inferior to 'minFactor' of 0.000976562 I then tried to set the 'minFactor' value like this: re...
2006 Sep 11
4
syntax of nlme
...nls and lme. after trying very hard, I ask for help on using nlme. Can someone hint me to some examples? I constructed a try using the example from nls: #variables are density, conc and Run #all works fine with nls DNase1 <- subset(DNase, Run == 1 ) fm2DNase1 <- nls( density ~ 1/(1 + exp((xmid - log(conc))/scal)), data = DNase1, start = list(xmid = 0, scal = 1), trace = TRUE) #Now I want to do a mixed model with covariate Run #how is the syntax? DNase12 <- subset(DNase, Run == 1 | Run == 2) fm2DNase1 <- nlme( density ~ 1/(1...
2009 Nov 09
1
Parameter info from nls object
...information provided by the summary method programmatically. Still I could not find out which method to use to get to those data. Example (not my real world data, but to show the point): [BEGIN] > DNase1 <- subset(DNase, Run == 1) > fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1) > summary(fm1DNase1) Formula: density ~ SSlogis(log(conc), Asym, xmid, scal) Parameters: Estimate Std. Error t value Pr(>|t|) Asym 2.34518 0.07815 30.01 2.17e-13 *** xmid 1.48309 0.08135 18.23 1.22e-10 *** scal 1.04146 0.03227 32.27 8.51e-14 *** --...
2001 Aug 08
1
NLME augPred error
...3.pen.nlme, primary=~day) Error in predict.nlme(object, value[1:(nrow(value)/nL), , drop = FALSE], : Levels 1,2,3 not allowed for block > predict.nlme(area3.pen.nlme) does not produce an error. area3.pen.nlme was created with: > area3.pen.nlme <- nlme(area ~ SSlogis(day, Asym, xmid, scal), + data=area.pen.data, + fixed = Asym + xmid + scal ~ dose + block, + random = Asym + xmid + scal ~ 1|seedling, + weights = varPower(), + start = c(2887,0,0,0,10.7,0,0,0,2.29,0,0,0)) > area, day and dose are numeric block and seedling are factors area is the area in mm2 of one gro...
2009 Oct 02
1
nls not accepting control parameter?
...152241, 153919, 155580, 157258, 158981, 160591, 162126, 163743, 165213, 166695, 168023, 169522, 170746, 172057, 173287, 173977, 175232, 176308, 177484) ) nls( y ~ SSlogis(x, Asym, xmid, scal), data = dat, trace=TRUE) (newMinFactor <- 1/(4*1024)) nls( y ~ SSlogis(x, Asym, xmid, scal), data = dat, control=nls.control(minFactor=newMinFactor), trace=TRUE) nls( y ~ SSlogis(x, Asym, xmid, scal), data = dat, control=c(minFactor=newMinFactor), trace=TRUE) (newMinFactor <- 4/1024...
2009 May 04
1
how to change nlme() contrast parametrization?
How to set the nlme() function to return the answer without the intercept parametrization? #========================================================================================= library(nlme) Soybean[1:3, ] (fm1Soy.lis <- nlsList(weight ~ SSlogis(Time, Asym, xmid, scal),                        data = Soybean)) (fm1Soy.nlme <- nlme(fm1Soy.lis)) fm2Soy.nlme <- update(fm1Soy.nlme, weights = varPower()) plot(ranef(fm2Soy.nlme, augFrame = TRUE),      form = ~ Year * Variety, layout = c(3,1)) soyFix <- fixef(fm2Soy.nlme) options(contrasts = c("c...
2005 May 26
0
Confidence intervals for prediction based on the logistic equation
...;, "33", "34", "35", "36", "37", "38", "39", "40", "41", "42")) #function to bootstrap the model EC50C <- function (xdata,i) { nlsdata <- xdata[i,] Sur.nls <- nls( PCTSurv ~ 100/(100 + exp(( xmid - (LogWBCTEQa) )/scal ) ), data = nlsdata, start = list( xmid = 0, scal = 1 ), alg = "plinear", trace = TRUE ) #output xmid, modify to calc EC50 (if PCTSurv = 50 what is LogWBCTEQa) C <- coef(Sur.nls)[1] EC50C <- C...