similar to: nlm() vs. nls()

Displaying 20 results from an estimated 20000 matches similar to: "nlm() vs. nls()"

2002 Dec 06
2
Fitting 2D vs. 2D data with nls()
Dear R-experts! I have y(x) data, dim(y) == dim(x) == c(2000, 2) I'd like to fit them with nls: fit.result <- nls ( y ~ f(x, p1, p2, p3), start = list(p1 = ... , p2 = .. , p3 = ..) ) Actually I want to fit y[,1] ~ x[,1] and y[,2] ~ x[,2] *simulaneously*, with the same parameters set {p1, p2, p3}. I tried to feed R tha above formula, R errors with:
2002 Mar 26
1
anova() for nlm or nls
Dear R community, I am currently fitting non-linear models using nlm and nls. 1) I would like to compare the different models analogous to the comparison of linear models with anova(). Is there a function in R which allows to do that? 2) I would like to constrain the parameter ranges to positive values only. Is there an option in nlm or nls which allows to constrain parameter ranges? (So far I
2003 Oct 30
2
'nls' and its arguments
Dear R experts! I'd to fit data by 'nls' with me-supplied function 'fcn'. 1) I'd like 'fcn' to accept arbitrary arguments, i.e. I defined it as f(...) {<body>}. (Ok, that's not actually impotant). 2) Second, I would NOT like to supply every parameter in the formula. To illustrate this, let's look at the last example of 'nls' help
2004 Feb 19
1
Obtaining SE from the hessian matrix
Dear R experts, In R-intro, under the 'Nonlinear least squares and maximum likelihood models' there are ttwo examples considered how to use 'nlm' function. In 'Least squares' the Standard Errors obtained as follows: After the fitting, out$minimum is the SSE, and out$estimates are the least squares estimates of the parameters. To obtain the approximate standard
2004 Jun 25
1
understanding nlm
Hi, I am using the nlm() function to fit the following exponential function to some data by minimizing squared differences between predicted and observed values: csexponential<- function(x, t1, ti, p){ ti + abs(t1 - ti)*(exp(-(p*(x-1)))) } As background, the data is performance measured across time. As you might imagine, we get rapid improvement across the first couple of time points
2004 Jan 21
2
derivative of atan(x) and similar functions
Dear R experts. 'D()' function recognizes some of the analitical functions, such as sin, cos, etc. But I'd like to take analytical derivatives from asin, atan etc. functions. Are there any R packages providing that features? Thanks. -- Timur.
2001 Apr 27
3
nls question
I have a question about passing arguments to the function f that nlm minimizes. I have no problems if I do this: x<-seq(0,1,.1) y<-1.1*x + (1-1.1) + rnorm(length(x),0,.1) fn<-function(p) { yhat<-p*x+(1-p) sum((y-yhat)^2) } out<-nlm(fn,p=1.5,hessian=TRUE) But I would like to define fn<-function(x,y,p) { yhat<-p*x+(1-p) sum((y-yhat)^2) } so
2005 Aug 16
2
Registration with Asterisk server
Dear Asterisk community, sorry if I'm so stupid, but I couldn't register myself with Asterisk. I created the [sip-incoming] context in the sip.conf: [sip-incoming] type = peer username = elzhov port = 5062 ; my kphone listens port 5062 host = 127.0.0.1 Then run Asterisk, and checked peers that are known for Asterisk: *CLI> sip show peers Name/username
2014 Sep 02
0
unexpected behavior of <<- in nlm (lazy?)
Hi, while working with closures in deSolve we have found unexpected behavior in R 3.1.0 and R 3.1.1 and R devel, while it was still as expected in R 3.0.3. This behavior occurs also in several functions of other packages like nls.lm from minpack.lm and even nlm in base, while some other functions worked as expected. See example below. The symptom is that super assignments (<<-) of
2008 Oct 13
0
optim and nlm error to estimate a matrix
Dear R users, I'm trying to estimate the matrix of regression parameters. I need to do it numerically, so I used optim and nls. I got the initial parameter estimates from least squares, and input them into those functions. But when I run the optim function, it stops in 30 seconds and shows 'convergence=1'. And if I use the nlm function, then it runs for a while, and finally stops
2003 Aug 01
2
'format' problem
Dear R experts, format(12345678, digits = 2) gives [1] "1.2e+07" while format(1234567, digits = 2) gives [1] "1234567" but I'd like the last number to be represented as "1.2e+06" string too. Where am I wrong? Thanks, Timur.
2005 Apr 17
1
nls segmented model with unknown joint points
Hello, I am interested in fitting a segmented model with unknown joint points in nls and perhaps eventually in nlme. I can fit this model in sas (see below, joint points to be estimated are a41 and a41), but am unsure how to specify this in the nlm function. I would really appreciate any suggestions or example code. Thanks a lot. -andy proc nlin data=Stems.Trees; params b41=-3 b42=1.5
2010 Nov 08
1
try (nls stops unexpectedly because of chol2inv error
Hi, I am running simulations that does multiple comparisons to control. For each simulation, I need to model 7 nls functions. I loop over 7 to do the nls using try if try fails, I break out of that loop, and go to next simulation. I get warnings on nls failures, but the simulation continues to run, except when the internal call (internal to nls) of the chol2inv fails.
2003 Feb 10
1
Zero rows/cols in the hessian matrix
Dear R experts! I try to minimize a function with external C fitting function. I get the hessian matrix. Here it is: [,1] [,2] [,3] [,4] [1,] 1.8816631 0 0.8859803 0 [2,] 0.0000000 0 0.0000000 0 [3,] 0.8859803 0 0.4859983 0 [4,] 0.0000000 0 0.0000000 0 Second and fourth rows/columns have zero values only. That's OK, because that ones related
2010 Sep 05
0
cov.unscaled in NLS - how to define cov.scaled to make comparable to SAS proc NLIN output - and theoretically WHY are they different
I am running a 3-parameter nonlinear fit using the default Gauss-Newton method of nls. initialValues.L = list(b=4,d=0.04,t=180); fit.nls.L = nls( myModel.nlm , fData.L, start = initialValues.L, control = nls.control(warnOnly = TRUE), trace=T ); summary.nls.L = summary(fit.nls.L); I run the same analysis in SAS proc NLIN. proc nlin data=apples outest=a; parms b=4 d=.04 t=180; model Y =
2010 Apr 06
1
estimating the starting value within a ODE using nls and lsoda
All- I am interested in estimating a parameter that is the starting value for an ODE model. That is, in the typical combined fitting procedure using nls and lsoda (alternatively rk4), I first defined the ODE model: minmod <- function(t, y, parms) { G <- y[1] X <- y[2] with(as.list(parms),{ I_t <- approx(time, I.input, t)$y dG <- -1*(p1 + X)*G +p1*G_b dX <-
2008 Mar 13
0
new version of minpack.lm
The package minpack.lm allows nonlinear regression problems to be addressed with a modification of the Levenberg-Marquardt algorithm based on the implementation of 'lmder' and 'lmdif' in MINPACK. Version 1.0-8 of the package is now available on CRAN. Changes in version 1.0-8 include: o possibility to obtain standard error estimates on the parameters via new methods for
2008 Mar 13
0
new version of minpack.lm
The package minpack.lm allows nonlinear regression problems to be addressed with a modification of the Levenberg-Marquardt algorithm based on the implementation of 'lmder' and 'lmdif' in MINPACK. Version 1.0-8 of the package is now available on CRAN. Changes in version 1.0-8 include: o possibility to obtain standard error estimates on the parameters via new methods for
2016 Apr 15
1
nlm() giving initials as estimates of parameters
Hi R community I have written a loglikelihood function which I am minimizing using nlm(). nlm() is giving me no results...I mean, I am getting initial values as estimates. No iteration. I have tried many initials value close to true values and far away from tru values. But every time I am getting initial values as estimates and no iteration. Anybody can guide why this happens. Thank You
2009 Apr 22
0
Rép : How to compare parameters of non linear fitting curves - COMPLETE REPLY -
Oups, I sent the email by error, as I was still writing my reply… Spencer, Le 22-avr.-09 à 03:33, spencerg a écrit : > Is your first model a special case of the second with eta1 = 0? > If yes, what about using 2*log(likelihood ratio) being approximately > chi-square? Yes, the first model is a special case of the second with eta1=0… Could you give me more explanation about