Displaying 20 results from an estimated 6000 matches similar to: "nls"
2009 Sep 06
2
question about ... passed to two different functions
I have hit a problem with the design of the mcmc package I can't
figure out, possibly because I don't really understand the R function
call mechanism. The function metrop in the mcmc package has a ... argument
that it passes to one or two user-supplied functions, which are other
arguments to metrop. When the two functions don't have the same arguments,
this doesn't work.
2005 Jun 01
1
nls(() and trace
hi everybody,
is there a canonical way to get hold of the "trace=TRUE" output from
nls, i.e. to copy it to a R variable (or at least to an external log file)?
I have only found the possibility to "fix(nlsModel)" (and than the
correct copy of that: namespace function ...) within the R-session by
modifying the trace() definition within nlsModel. not really good for
everyday
2009 Dec 18
2
NLS-Weibull-ERROR
Hello
I was trying to estimate the weibull model using nls after putting OLS
values as the initial inputs to NLS.
I tried multiple times but still i m getting the same error of Error in
nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates.
The Program is as below
> vel <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
> df <- data.frame(conc, vel)
>
2006 Sep 15
1
Formula aruguments with NLS and model.frame()
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
2011 Jun 30
1
Error "singular gradient matrix at initial parameter estimates" in nls
Greetings,
I am struggling a bit with a non-linear regression. The problem is
described below with the known values r and D inidcated.
I tried to alter the start values but get always following error
message:
Error in nlsModel(formula, mf, start, wts):
singular gradient matrix at initial parameter estimates
Calls: nls -> switch -> nlsModel
I might be missing something with regard to the
2011 May 04
1
hurdle, simulated power
Hi all--
We are planning an intervention study for adolescent alcohol use, and I
am planning to use simulations based on a hurdle model (using the
hurdle() function in package pscl) for sample size estimation.
The simulation code and power code are below -- note that at the moment
the "power" code is just returning the coefficients, as something isn't
working quite right.
The
2005 Jul 26
1
SETAR Estimation
Dear R-helpers,
I was wondering if anyone has or knows someone who might have an implementation
of algorithm for estimating SETAR models including the lag-order. For some
reason my code gives me a bit wrong results. I am fighting with it for a week
and cannot bring it down.
Thanks a million in advance,
Sincerely,
Evgueni
McGill University
Department of Economics
2004 Jun 10
2
nls and R scoping rules
I apologize for posting this in essence the second time (no light at the
end of the tunnel yet..):
is there a way to enforce that "nls" takes 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 <-
2005 Dec 01
2
Minimizing a Function with three Parameters
Hi,
I'm trying to get maximum likelihood estimates of \alpha, \beta_0 and
\beta_1, this can be achieved by solving the following three equations:
n / \alpha + \sum\limits_{i=1}^{n} ln(\psihat(i)) -
\sum\limits_{i=1}^{n} ( ln(x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} 1/(psihat(i)) - (\alpha+1)
\sum\limits_{i=1}^{n} ( 1 / (x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} (
2007 Feb 13
1
nls: "missing value or an infinity" (Error in numericDeriv) and "singular gradient matrix"Error in nlsModel
Hi,
I am a non-expert user of R. I am essaying the fit of two different functions to my data, but I receive two different error messages. I suppose I have two different problems here... But, of which nature? In the first instance I did try with some different starting values for the parameters, but without success.
If anyone could suggest a sensible way to proceed to solve these I would be
2011 Nov 30
2
nls help
Hello,
I have data like the following:
datum <- structure(list(Y = c(415.5, 3847.83333325, 1942.833333325,
1215.22222233333,
950.142857325, 2399.5833335, 804.75, 579.5, 841.708333325, 494.053571425
), X = c(1.081818182, 0.492727273, 0.756363636, 0.896363636,
1.518181818, 0.499166667, 1.354545455, 1.61, 1.706363636, 1.063636364
)), .Names = c("Y", "X"), row.names = c(NA,
2006 Aug 26
1
problems with loop
Dear all,
I am trying to evaluate the optimisation behaviour of a function. Originally
I have optimised a model with real data and got a set of parameters. Now I
am creating simulated data sets based on these estimates. With these
simulations I am estimating the parameters again to see how variable the
estimation is. To this end I have written a loop which should generate a new
simulated data
2008 Sep 12
1
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
I use "while" loop but it produces an errro. I have no idea about this.
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
nothing to replace with
The problem description is
The likelihood includes two parameters to be estimated: lambda
(=beta0+beta1*x) and alpha. The algorithm for the estimation is as
following:
1) with alpha=0, estimate lambda (estimate beta0
2013 Mar 14
2
question about nls
Hi,all:
I met a problem of nls.
My data:
x y
60 0.8
80 6.5
100 20.5
120 45.9
I want to fit exp curve of data.
My code:
> nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1))
Error in nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates
I can't find out the reason for the error.
Any suggesions are welcome.
Many thanks.
[[alternative HTML
2008 Aug 22
2
WinBUGS with R
Dear Users,
I am new to both of things, so do not blame me too much...
I am busy with semiparametric regression and use WinBUGS to sample
posteriors.
The code to call Winbugs is as follows:
data <- list("y","X","n","m") #My variables
inits.beta <- rep(0,K)
inits.beta0 <- 0
inits <-
2009 Aug 25
3
Covariates in NLS (Multiple nonlinear regression)
Dear R-users,
I am trying to create a model using the NLS function, such that:
Y = f(X) + q + e
Where f is a nonlinear (Weibull: a*(1-exp(-b*X^c)) function of X and q is a covariate (continous variable) and e is an error term. I know that you can create multiple nonlinear regressions where x is polynomial for example, but is it possible to do this kind of thing when x is a function with unknown
2004 Oct 07
1
confidence interval for nls
Do I have the right impression that it's currently not possible to
produce confidence intervals for the nls predictions using R?
I had a course were we used SAS PROC nlin and there you could get
intervals for the parameters and the prediction but I do not have access
to SAS.
Would it be difficult to implement, I tried to dig into the help pages
of nls, vcov and nlsModel but I could not
2013 Jan 02
1
Need help with self-defined function to perform nonlinear regression and get prediction interval
Dear All,
I was trying to call a self-defined function that performs nonlinear
regression and gets the corresponding prediction upper limit using nls2
package. However, weird thing happened. When I called the function in the
main program, an error message "fitted(nlsmodel): object 'nlsmodel' not
found" came up. But when I directly ran the codes inside the function, no
error came
2010 Aug 13
2
Unable to retrieve residual sum of squares from nls output
Colleagues,
I am using "nls" successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of squares. I have assigned the output to FIT:
> > FIT
> Nonlinear regression model
> model: NEWY ~ PMESOR + PAMPLITUDE * cos(2 * pi * (NEWX - POFFSET)/PERIOD)
> data: parent.frame()
> PMESOR PAMPLITUDE POFFSET
>
2010 Apr 28
1
NLS "Singular Gradient" Error
Hello,
I am trying to model a type II functional response of number of prey eaten
(Ne) against number supplied (No) with a non-linear least squares regression
(nls). I am using a modification of Holling's (1959) disc equation to
account for non-replacement of prey;
Ne=No{1-exp[a(bNe-T)]}
where a is the attack rate, b is the handling time, and T is the
experimental period.
My script is as