Displaying 20 results from an estimated 74 matches for "selfstart".
2009 Oct 17
1
custom selfStart model works with getInitial but not nls
Hello,
I'm having problems creating and using a selfStart model with nlme. Briefly,
I've defined the model, a selfStart object, and then combined them to make a
selfStart.default model.
If I apply getInitial to the selfStart model, I get results. However, if I try
usint it with nls or nlsList, these routines complain about a lack of initial
con...
2009 Nov 12
0
writing selfStart models that can deal with treatment effects
Hello,
I'm trying to do some non-linear regression with 2 cell types and 4 tissue
type treatments using selfStart models
Following Ritz and Streibig (2009), I wrote the following routines:
##Selfstart
expDecayAndConstantInflowModel <- function(Tb0, time, aL, aN, T0){
exp(-time*aL)*(T0*aL+(-1+exp(time * aL))*Tb0 * aN)/aL
}
expDecayAndConstantInflowModelInit <- function(mCall, LHS, data){
print(pa...
2008 Aug 18
1
"nested" getInitial calls; variable scoping problems
Hi All,
Another nls related problem (for background, I'm migrating a complicated
modelling package from S-plus to R).
Below I've reduced this to the minimum necessary to demonstrate my problem
(I think); the real situation is more complicated.
Two similar selfStart functions, ssA and ssB.
The 'initial' function for ssB modifies its arguments a little and then
calls getInital for ssA.
In addition to the "x" and the fitted coefficients ("Coeff"), ssA and ssB
have arguments ("A") which are not the same length as the datafr...
2007 Sep 29
1
[Help] Error when using nls
..."~/Documents/R/Wu_data.dat", header=TRUE)
# assign variables
Z <- Wu[[1]] # N1,60
X <- Wu[[2]] # CSR
Y <- Wu[[3]] # ev, %
# set the data frame
data1<- data.frame(cbind(N,CSR,ev))
# call nls funciton
out <- nls(Z~X/(1/(a+b*ev+c*(Y^2))+X/(d+e*exp(f*Y)))-g, data1,
selfStart, trace=T)
In total there are 59 sets of (X,Y,Z). When I run this script, I got
the error message as:
parameters without starting value in 'data': a, b, d, e, f, g
I don't know what this means. Besides, I use "selfStart" option, such
that the nls is supposed to run by...
2009 Sep 04
1
How should a SelfStart function handle illegal parameter values?
Hi Everyone,
I'm trying to write selfStart non-linear models for use with nls. In these
models some combinations of parameter values are illegal; the function value
is undefined.
That's OK when calling the function directly [e.g. SSmodel(x, pars...)]; I
return an appropriate non-value such as NA or Inf.
However, when called from n...
2009 Sep 21
1
How to use nls when [selfStart] function returns NA or Inf??
Hi Everyone,
I posted this a couple of weeks ago with no responses. My interface (via
gmane) seemed a bit flakey at the time, so I'm venturing to repost with some
additional information.
I'm trying to write selfStart non-linear models for use with nls. In these
models some combinations of parameter values are illegal; the function value
is undefined.
That's OK when calling the function directly [e.g. SSmodel(x, pars...)]; it
is appropriate to return an appropriate non-value such as NA or Inf.
However, w...
2006 Feb 12
1
lme, nlsList, nlsList.selfStart
Dear listers,
I am trying to fit a model using nlsList() using alternately a SSfol()
selfstart function or its developped equivalent formulae.
This preliminary trial works well
mydata<-groupedData(Conc~Tps|Organ,data=mydata)
mymod1<-nls(Conc~SSfol(Dose,Tps,lKe,lKa,lCl),data=mydata)
as well as a developped form:
mymod2<-nls(Conc~Dose * exp(lKe+lKa-lCl) *
(exp(-exp(lKe)*Tps)-exp(...
2006 Nov 13
2
notepad selfstart on login
hi all;
I'm starting in PDC and need some help, i'm using samba for pdc but without
ldap, and all time that a user make login, open a notepad with the content:
[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21787
or
[DeleteOnCopy]
Owner=cesar
Personalized=5
PersonalizedName=My documents
and all folder have a document Desktop.ini...
someone can say me why
2002 Jul 19
1
selfStart function problem
...quot;D"]],'+5.8)^-1.0)')
+ print(equation)
+ linear <- lm(as.formula(equation),data=data)
+ value <- c(exp(coef(linear)[1]), coef(linear)[2], 1.0)
+ names(value) <- mCall[c("a", "b", "c")]
+ value
+ }
>
> dhexp <- selfStart(dhexp, initial=dhexpInit)
>
> getInitial(height ~ dhexp(diameter,a,b,c), spruce)
[1] "log( height ) ~ I(( diameter +5.8)^-1.0)"
a b c
39.78098 -25.34938 1.00000
>
> getInitial(I(height-1.3) ~ dhexp(diameter,a,b,c), spruce)
[1] "log( I ) ~ I(( di...
2008 Aug 04
0
Unexpected nls behaviour: Solved
Hi Everyone,
I'd omitted the non-optional 'parameters' argument to selfStart. Making this
change to SSbatch gives the same (successful) result from the two calls to
nls.
SSbatch<-selfStart(
model=function(Batch, Coeffs)
{
Coeffs[Batch]
}
,initial=function(mCall, data, LHS)
{
# Estimate coefficients as mean of each batch
xy <- sortedXyData(mCall[["Batc...
2008 Sep 26
0
The 'data' argument and scoping in nls
...help pages,
but nothing on a strategic level, what general approach should I use? Can
someone point me in the right direction?
I'm using nls to fit models where some non-optimised parameters are
different lengths from the data, often matrices, something like this ...
----------
SSfunc <- selfStart(
model = function(x, Coeff, A)
{
},
initial = function(mCall, data, LHS)
{
},
parameters = c("Coeff")
)
y <- ...
x <-...
A <- ...
nls(y ~ SSfunc(x, Coeff, A), data=...)
--------------------
... where A may be a matrix. This means that A canno...
2007 Feb 13
1
nls: "missing value or an infinity" (Error in numericDeriv) and "singular gradient matrix"Error in nlsModel
...in numericDeriv(form[[3]], names(ind), env) :
Missing value or an infinity produced when evaluating the model
In addition: Warning message:
No starting values specified for some parameters.
Intializing 'b', 'a' to '1.'.
Consider specifying 'start' or using a selfStart model in: nls(fath ~ ((b^2)/(a^2)) * exp((-dist/a)^b), polcurve)
#Geometric function
>s=nls(fath~((b-1)*(b-2)/a)*((1+dist/a)^-b),polcurve)
Error in nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates
In addition: Warning message:
No starting v...
2010 Apr 15
0
nlsList {nlme} - control arguments problem
Hi Rick
Thanks to Dieter Menne I did manage to solve the problem of imposing bounds on
the parameter space duirng an nlsList fit. He suggested using optim to optimize
the parameters prior to each fit. This worked well for me as I had a customized
selfStart function that then optimized the parameters for each individual
separately.
if you rewrote your selfStart function as:
powrDpltInit <-
function(mCall, LHS, data) {
xy <- sortedXyData(mCall[["x"]],LHS,data)
min.s <- min(y)
dif.s <- max(y)-min(y)
dplt.s &l...
2002 Jan 04
0
Re: initial values for non linear models? {was "Info_Request"}
...don't say
anything about your model which would help to help you...
nls in package nls, {i.e. you type library(nls)} has so called
self-starting models for a few classes of non-linear *regression* models.
I don't know if this helps, since nlm() is not only for regression models.
type ?selfStart
and apropos("^SS") to get a list of predefined selfstarting
models, and then, e.g. ?SSlogis
Further you may need to learn more about non-linear regression in general.
E.g.,
Bates, D.M. and Watts, D.G. (1988) Nonlinear Regression Analysis
and Its Applications; Wiley.
and...
2006 Feb 01
1
Passing additional paramaters to nlsList(nlme) fit function
Hello, nls-users,
is it possible to pass additional parameters to the model function that are
known and groupwise constant with nlsList? I could not find something like a
"keep this fixed" option in the documentation and the code (my fault...?)
The current workaround is to break the problem down into groups and use
globals to pass the constant parameters, but it is ugly code and
2008 Aug 01
0
Unexpected nls behaviour
Hi everyone,
I thought that for a selfStart function, these two should be exactly
equivalent
> nls(Aform, DF)
> nls(Aform, DF, start=getInitial(Aform, DF))
but in this example that is not the case in R (although it is in S-plus
V6.2)
------------------------------
SSbatch<-selfStart(
model=function(Batch, Coeffs)
{
Coeffs[Batch]...
2010 Jul 12
1
Custom nonlinear self starting function w/ 2 covariates
...nd of
beta function with 2 parameters (optimal and maximum temperatures) and the
time function is a 2-parameter Weibull. Adjustments with nls or gnls work,
but I need to do mixed-effects modeling.
It seems like nlme or nlmer need self starting functions, but so far I can't
find a way to code a selfstart function with 2 "x" covariates. Is it just
impossible? Is there another way?
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/Custom-nonlinear-self-starting-function-w-2-covariates-tp2286099p2286099.html
Sent from the R help mailing list archive at Nabble.com.
2012 Jun 13
0
logistic Regression with SSlogis but y == 0 ?!
Hello there!
I got some data with x and y values. there are some y == 0. This is a
problem for the selfstarting regression model SSlogis.
The regression works if I use a non selfstarting model. The formula is the
same. But this needs very detailed information of the starting list. I dont
have this Information all the time.
An easy solution for selfstart model could be to add 1E-100 to the y==0
values. T...
2001 Apr 29
1
Self-starting nls functions
Hello,
I am doing several self-starting growth functions for using with nls(). When
I list the self-starting functions included in nls library, for instance,
SSlogis, there is:
> SSlogis
function (input, Asym, xmid, scal)
...
<environment: 03476D20>
attr(,"class")
[1] "selfStart"
What is this <environment: 03476D20> instruction?
By using deriv() and then Selfstart(), I don't get this, although everything
works fine without it.
Thanks for help.
Best Regards,
Philippe Grosjean
...........]<(({?<...............<?}))><.............................
2006 May 24
1
problem-nlme
...<- sortedXyData(mCall[["x"]], LHS, data)
Linf <- 900
if (Linf != max(xy[,"y"])) Linf <- -Linf
K <- 0.3
t0<-0
value <- c(Linf, K, t0)
names(value) <- mCall[c("Linf", "K","t0")]
value
}
vonBert <- selfStart(vonBert, initial = vonBertInit)
class(vonBert)
#Richards
Rich <- function(x, Linf, K, t0, m)
Linf*(1-exp(-K*(x-t0)))^(1/(1-m))
size ~ Rich(age, Linf, K, t0, m)
Rich <-deriv(~ Linf*(1-exp(-K*(x-t0)))^(1/(1-m)),
c("Linf","K","t0","m"),functio...