Displaying 20 results from an estimated 38 matches for "ssfpl".
2002 Sep 27
2
How to apply SSfpl with binary data
Dear R-help subscribers
Would you tell me how to apply SSfpl with binary data as below?
Unfortunately, there is not the EXAMPLE in help(SSfpl) for binary data but for quantitative data(Chick).
V1: dose
V2: log-transformed dose
V3: response (rate)
V1 V2 V3
1 0.775 -0.2548922 0.1666667
2 5.000 1.6094379 0.8148148
3 10.000 2.3025851...
2009 Oct 19
2
How to get slope estimates from a four parameter logistic with SSfpl?
Hi,
I was hoping to get some advice on how to derive estimates of slopes from four parameter logistic models fit with SSfpl.
I fit the model using:
model<-nls(temp~SSfpl(time,a,b,c,d))
summary(model)
I am interested in the values of the lower and upper asymptotes (parameters a and b), but also in the gradient of the line at the inflection point (c) which I assume tells me my rate of increase when it is steepest (?...
2001 May 01
0
SSfpl self-start sometimes fails... workaround proposed
...ot;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).
As a workaround, I propose a modified self-start function for SSfpl that
remedy to this:
---------------------------------------
fpl <- function (input, A, B, xmid, scal)
{
.expr1 <- B - A
.expr2 <- xmid - input
.expr4 <- exp((.expr2/scal))
.expr5 <- 1 + .expr4
.expr8 <- 1/.expr5
.expr13 <- .expr5^2
.value <- A +...
2003 Sep 30
2
non-linear trends in kriging model
Hi
I am struggling to fit a non-linear trend using the
likfit function in geoR.
Specifically I want a sigmoidal function, something
like SSfpl in the nls package to fit the trend. But
it seems trend.spatial in geoR only works with lm or
glm type models.
Any ideas how I can specify the model to calculate the
kriging parameters using REML, including the
parameters of a sigmoidal trend function (such as
SSfpl)?
Thanks
David
2003 Feb 22
2
4-parameter logistic model
...xp((theta3-x)/theta4)) ==
y(x)=A+(B-A)/(1+exp((xmid-input)/scal))
from the graph in page 518 of the book of the same authors (mixed models in
S) theta 1 corresponds to the horizontal asymptote as x goes to infinity and
theta2 the horizontal asymptote as x goes to -infinity. When I use the
function SSfpl(input,A,B,xmid,scal), I'm not sure why the value of A is the
lower of the two asymptotes if according to the original function A should
be equal to theta1 (upper asymptote).. or maybe I'm wrong.
I'll appreciate any comment on this.
Best Regards
CM
2008 Feb 19
0
nlsList - Error in !unlist(lapply(coefs, is.null))
...duals (using R v. 2.3.1). Yet, if I want to obtain the
parameters for each individual (i.e., for each 'id') using nlsList, then I
obtain an Error message which I have trouble interpreting. Any advice as to
how I can solve this problem?
Thanks for your time,
Marc
> reg <-nls(mass ~ SSfpl(age, A, B, xmid, scal),
+ na.action=na.omit,
+ data=data)
> summary(reg)
Formula: mass ~ SSfpl(age, A, B, xmid, scal)
Parameters:
Estimate Std. Error t value Pr(>|t|)
A 1.42895 0.24472 5.839 5.43e-09 ***
B 21.71508 0.06551 331.495 < 2e-16 ***
xmid 5.93563 0.0...
2005 Apr 23
1
start values for nls() that don't yield singular gradients?
...tarting values that don't result in singular gradients?
I have had no luck with the "selfStart" models, e.g., "SSgompertz"
-- the formula in "SSgompertz" is not the same as the one I need
above, since it has three parameters instead of four. I've tried
it and SSfpl thusly:
> getInitial(y ~ SSfpl(x,a,b,c,d),data=data.frame(x=x,y=y))
Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data =
xy, :
step factor 0.000488281 reduced below `minFactor' of 0.000976563
And this:
> getInitial(y ~ SSgompertz(x,a,b,c),data=data.frame(x...
2005 Nov 13
4
Robust Non-linear Regression
...t is possible to specify weights, possibly that is the way to do
it, but I didn't manage to get it working
the weights should then be something like:
SUM (log(1+(resid(.)/quantile(all_residuals,0.68))^2)) / SUM (resid(.))
the test data I use :
x<-seq(-5,-2,length=50)
x<-rep(x,4)
y<-SSfpl(x,0,100,-3.5,1)
y<-y+rnorm(length(y),sd=5)
y[sample(1:length(y),floor(length(y)/50))]<-200 # add 2% outliers at 200
thanks a lot
Hans Vermeiren
[[alternative HTML version deleted]]
2003 Jul 10
6
info
HI
I'm a student in chemical engineering, and i have to implement an algoritm about FIVE PARAMETERS INTERPOLATION for a calibration curve (dose, optical density)
y = a + (c - a) /(1+ e[-b(x-m])
where
x = ln(analyte dose + 1)
y = the optical absorbance data
a = the curves top asymptote
b = the slope of the curve
c = the curves bottom asymptote
m = the curve X intercept
Have you never seen
2011 Jan 24
0
tolerance limits for nls predicted values
...kage
but the self-starting functions are not in the derivitive tables. When I
spellout the functions and supply starting values I repeatedly get an
error message regardless of the starting values I use (see output below).
Does anyone have a solution for this problem?
> oh_fit2<-nls(MBB ~ SSfpl(AGE, a, b, c, d))
> oh_fit2
Nonlinear regression model
model: MBB ~ SSfpl(AGE, a, b, c, d)
data: parent.frame()
a b c d
9.308 36.420 67.982 12.815
residual sum-of-squares: 46834
Number of iterations to convergence: 9
Achieved convergence tolerance: 8.727e-06
&...
2008 Feb 18
2
skip non-converging nls() in a list
...r of individuals using
a 4-parameter logistic growth curve.
2. nlme does not converge with the random structure that I want to use.
3. nlsList does not converge for some individuals.
4. I decided to go around nlsList using:
t(sapply(split(data, list(data$id)),
function(subd){coef(nls(mass ~ SSfpl(age, A, B, xmid, scal), data =
subd))}))
5. This does not converge either:
'Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data = xy,
:
singular gradient'
6. Would anyone know if I can get R to skip non-converging use of nls() so
that I can at least obtain the par...
2017 Jul 10
4
fit lognorm to cdf data
Dear all
I am struggling to fit data which form something like CDF by lognorm.
Here are my data:
proc <- c(0.9, 0.84, 0.5, 0.16, 0.1)
size <- c(0.144, 0.172, 0.272, 0.481, 0.583)
plot(size, proc, xlim=c(0,1), ylim=c(0,1))
fit<-nls(proc~SSfpl(size, 1, 0, xmid, scal), start=list(xmid=0.2, scal=.1))
lines(seq(0,1,.01), predict(fit, newdata=data.frame(sito=seq(0,1,.01))), col=2)
I tried to fit with SSfpl, which is let say close but probably not enough. I tried to find how to fit lognorm CDF to my data but did not find an easy solution.
B...
2006 Aug 24
2
my error with augPred
...try to repeat 8.19 fig which is OK until I try:
fit4 <- update(fit2, fixed = list(A+B~1,xmid~vykon.fac, scal~1),
start = c(57, 100, 700, rep(0,3), 13))
I know I should provide an example but maybe somebody will be clever
enough to point me to an explanation without it.
nlme version 3.1-75
SSfpl model
R 2.4.0dev (but is the same in 2.3.1), W2000.
Thank you
Best regards.
Petr PikalPetr Pikal
petr.pikal at precheza.cz
2017 Jul 10
0
fit lognorm to cdf data
...> wrote:
>Dear all
>
>I am struggling to fit data which form something like CDF by lognorm.
>
>Here are my data:
>
>proc <- c(0.9, 0.84, 0.5, 0.16, 0.1)
>size <- c(0.144, 0.172, 0.272, 0.481, 0.583)
>plot(size, proc, xlim=c(0,1), ylim=c(0,1))
>fit<-nls(proc~SSfpl(size, 1, 0, xmid, scal), start=list(xmid=0.2,
>scal=.1))
>lines(seq(0,1,.01), predict(fit,
>newdata=data.frame(sito=seq(0,1,.01))), col=2)
>
>I tried to fit with SSfpl, which is let say close but probably not
>enough. I tried to find how to fit lognorm CDF to my data but did not
&...
2003 Aug 20
0
4 parameter logistic model
Hi, I am trying to fit a 4-parameter logistic model to
my gradient data using nls. I tried to specify the
model directly in the nls formula and also tried to
use the self-start function SSfpl. For the following
data, the first method worked, but the second didn't.
I thought both ways were equivalent, can anyone tells
me why?
>
test=data.frame(cbind(conc=c(13294,3940,1170,346,102,30.20,8.94,2.65,13294,3940,1170,346,102,30.20,8.94,2.65),
signal=c(2609,487,110,35,17.5,16,11,12.5,26...
2003 Aug 21
0
nls fitting inside a loop in S-Plus
...)
>
data2<-cbind(c(8.05,6.50,5.03,4.37,4.03,3.92,3.87,3.89,7.84,6.27,4.74,4.14,3.76,3.69,3.69,3.71),c(8.07,6.94,5.59,4.43,3.66,3.00,2.64,2.40,8.09,6.90,5.56,4.44,3.50,2.71,2.48,2.08))
> par(mfrow=c(2,2))
> for (i in 1:2) {
conc<-data1[,i]
signal<-data2[,i]
fit<-nls(signal~SSfpl(conc,A,B,xmid,scal))
p.conc<-data.frame(conc=(1:99)*(max(conc)-min(conc))/100+min(conc))
plot(as.numeric(p.conc[,1]),as.numeric(predict(fit,newdata=p.conc)),type='l',col=4)
}
When the above code was run in R, it worked very well,
but when it was run in S-plus, it gave me the
following...
2007 Jun 14
0
nlsList problems: control option does not effect output and strange environment search
...0-x[5])))^(1/x[3]))+rnorm(240,0,s
derror)
return(Y)}))
params contains different parameters for 200 persons in 4 groups. Next I
sample for each person five observations one at the start, one at the
end and three randomly in between. Now I get the following error
messages:
testnlslist2<-nlsList(SSfpl,groupedData(Y~Time|group, datset))
Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data =
xy, :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
Error in nls(formula = formula, data = data, control = control) :
singular gradient
For the fir...
2010 Mar 13
1
testing parallelism of does-response curves using nls()
...an then be used to test parallelism using either Chi-square or F test.
Now, fitting 2 separate curves are straight forward using nls(), but how to fit a global model to only allow "xmid" to be different among the 2 curves?
BTW, is there a selfStart function for 5-parameter logistic like SSfpl for 4-parameter logistic function?
Thanks very much,
John
2004 May 06
1
sporadic errors with nlrq() / optim()
...8.74608021735751, 7.58120982619635, 6.361302477573 ,
5.91889385427315, 5.63835466933375 , 5.80211837537706, 5.64897423816121,
8.6195692580331 , 8.70367275835886)
)
i <- 1
while(i < 500) { # I usually hit an error within 50 iterations
cat(i, "\n")
nlrq(y ~ SSfpl(x, A, B, xmid, scal), data = test)
i <- i + 1
}
###
Errors occur with version 1.8.1 and 1.9.0 on both Windows (two different
machines) and UNIX, but not on version 2.0 on a MAC (these are the only R
version - OS permutations I was able to get reports on easily).
Anyone understand what is h...
2005 Jun 02
1
nls.control: increasing number of iterations
Hello,
I'm using the nls function and would like to increase the number of
iterations. According to the documentation as well as other postings on
R-help, I've tried to do this using the "control" argument:
nls(y ~ SSfpl(x, A, B, xmid, scal), data=my.data,
control=nls.control(maxiter=200))
but no matter how much I increase "maxiter", I get the following error
message:
Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data =
xy, :
number of iterations exceeded maximum of 50
The...