Displaying 20 results from an estimated 111 matches for "scal".
Did you mean:
scale
2008 Jan 04
3
nls (with SSlogis model and upper limit) never returns (PR#10544)
...ver 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 "scal...
2011 Nov 17
3
Obtaining a derivative of nls() SSlogis function
...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", "xmid", &quo...
2004 Aug 16
2
using nls to fit a four parameter logistic model
...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
residual sum-of-squar...
2013 Mar 15
2
nlrob and robust nonlinear regression with upper and/or lower bounds on parameters
I have a question regarding robust nonlinear regression with nlrob. I
would like to place lower bounds on the parameters, but when I call
nlrob with limits it returns the following error:
"Error in psi(resid/Scale, ...) : unused argument(s) (lower = list(Asym
= 1, mid = 1, scal = 1))"
After consulting the documentation I noticed that upper and lower are
not listed as parameter in the nlrob help documentation. I haven't
checked the source to confirm this yet, but I infer that nlrob simply
doesn...
2001 Oct 07
1
Bug in Deriv? (PR#1119)
...s 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({
.expr...
2006 Jan 23
1
nlme in R v.2.2.1 and S-Plus v. 7.0
...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))
Data: jug...
2011 Aug 09
1
nls, how to determine function?
...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: dat...
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
effects, an...
2018 May 05
0
Bug in profile.nls with algorithm = "plinear"
...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> xmid 1.323034...
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.0049877349
att...
2005 May 10
2
predict nlme syntax
...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
Residual...
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:
reg.log...
2001 Aug 08
1
NLME augPred error
...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 growing l...
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 this message).
A...
2004 May 18
0
nlme: Initial parameter estimates
...od, 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 effects: lis...
2009 Oct 02
1
nls not accepting control parameter?
...1, 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)
nls(...
2006 Sep 11
4
syntax of nlme
...r 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 + exp((xmid - log(...
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("contr.t...
2004 Feb 20
1
nlme and multiple comparisons
This is only partly a question about R, as I am not quite sure about the
underlying statistical theory either.
I have fitted a non-linear mixed-effects model with nlme. In the fixed
part of the model I have a factor with three levels as explanatory
variable. I would like to use Tukey HSD or a similar test to test for
differences between these three levels.
I have two grouping factors:
2010 Sep 24
0
kernlab:ksvm:eps-svr: bug?
...response vector, y, is standardized at line 143:
142 if (is.numeric(y)&&(type(ret)!="C-svc"&&type(ret)!="nu-svc"&&type(ret)!="C-bsvc"&&type(ret)!="spoc-svc"&&type(ret)!="kbb-svc"))
{
143 y <- scale(y)
144 y.scale <- attributes(y)[c("scaled:center","scaled:scale")]
145 y <- as.vector(y)
146 }
2. fitted response, fitted(ret), is obtained at lines 826,827:
826 fitted(ret) <- if (fit)
827 predict(ret, x) else NULL
(note: during...