Displaying 3 results from an estimated 3 matches for "fifu".
Did you mean:
fifo
2004 Jun 10
2
nls and R scoping rules
...es both, the data *and* the
model definition from the parent environment? the following fragment
shows the problem.
#======== cut here==========
wrapper <- function (choose=0)
{
x <- seq(0,2*pi,len=100)
y <- sin(1.5*x);
y <- rnorm(y,y,.1*max(y))
if (choose==0) {
rm(fifu,pos=1)
fifu <- function(w,x) {sin(w*x)}
}
else
assign('fifu',function(w,x) {sin(w*x)},.GlobalEnv)
res <- nls(y ~ fifu(w,x),start=list(w=1))
res
}
#======== cut here==========
if called as "wrapper(1)" this runs fine because the fitting function
&qu...
2012 Jul 03
1
nls problem
...ng a length equal to the `nls' variable
# `respLength'. the problem arises when there are `varNames'
# components accidentally having this length, too.
# in the present example, setting the number of data points to
# len=2 triggers the error since the `call' object `fifu' has this
# length, too and `nls' constructs an erroneous `mf$formula' internally.
#=======================================================================
#generate some data
x <- seq(0, 4, len = len)
y <- exp(-x)
y <- rnorm(y, y, .001*y)
data <- lis...
2004 Jun 03
5
Confidence intervals for predicted values in nls
Dear all
I have tried to estimate the confidence intervals for predicted values of a
nonlinear model fitted with nls. The function predict gives the predicted
values and the lower and upper limits of the prediction, when the class of
the object is lm or glm. When the object is derived from nls, the function
predict (or predict.nls) gives only the predicted values. The se.fit and
interval aguments