search for: nlsr

Displaying 20 results from an estimated 27 matches for "nlsr".

Did you mean: nls
2023 Nov 06
2
non-linear regression and root finding
Dear friends - I have a function for the charge in a fluid (water) buffered with HEPES and otherwise only containing Na and Cl so that [Na] - [Cl] = SID (strong ion difference) goes from -1 mM to 1 mM. With known SID and total HEPES concentration I can calculate accurately the pH if I know 3 pK values for HEPES by finding the single root with uniroot Now, the problem is that there is some
2017 Jun 18
0
R_using non linear regression with constraints
...are useful, but it takes some time to sort them all out and make sense of the problem as a whole. Right now I'm getting ready to go to UseR!, so probably won't have time to spend sorting things out, though I'll have a go if I get time. David: Did you get a crash with the Mac version of nlsr? (You have the latest version I uploaded to CRAN.) I don't have Mac, just Linux and a very ancient Win XP. I suspect the latter is too old to take seriously. I use Win-Builder for package checks. I don't think there's anything seriously wrong with nlsr functions, but there is more to b...
2017 Jun 18
3
R_using non linear regression with constraints
...# Green point is brute-force solution # Red point is optimizer solution for myfun2 ##----------end On Sun, 18 Jun 2017, J C Nash wrote: > I ran the following script. I satisfied the constraint by > making a*b a single parameter, which isn't always possible. > I also ran nlxb() from nlsr package, and this gives singular > values of the Jacobian. In the unconstrained case, the svs are > pretty awful, and I wouldn't trust the results as a model, though > the minimum is probably OK. The constrained result has a much > larger sum of squares. > > Notes: > 1) nls...
2017 Jun 18
0
R_using non linear regression with constraints
I ran the following script. I satisfied the constraint by making a*b a single parameter, which isn't always possible. I also ran nlxb() from nlsr package, and this gives singular values of the Jacobian. In the unconstrained case, the svs are pretty awful, and I wouldn't trust the results as a model, though the minimum is probably OK. The constrained result has a much larger sum of squares. Notes: 1) nlsr has been flagged with a check er...
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
Thank you so much Dr. Nash, I truly appreciate your kind and valuable contribution. Cheers, Paul El El s?b, 19 de ago. de 2023 a la(s) 3:35 p. m., J C Nash < profjcnash at gmail.com> escribi?: > Why bother. nlsr can find a solution from very crude start. > > Mixture <- c(17, 14, 5, 1, 11, 2, 16, 7, 19, 23, 20, 6, 13, 21, 3, 18, 15, > 26, 8, 22) > x1 <- c(69.98, 72.5, 77.6, 79.98, 74.98, 80.06, 69.98, 77.34, 69.99, > 67.49, 67.51, 77.63, > 72.5, 67.5, 80.1, 69.99, 72.49, 64....
2017 Jun 18
3
R_using non linear regression with constraints
https://cran.r-project.org/web/views/Optimization.html (Cran's optimization task view -- as always, you should search before posting) In general, nonlinear optimization with nonlinear constraints is hard, and the strategy used here (multiplying by a*b < 1000) may not work -- it introduces a discontinuity into the objective function, so gradient based methods may in particular be
2023 Jan 26
1
Potential bug in fitted.nls
Doesn't nls() expect that the lengths of vectors on both sides of the formula match (if both are supplied)? Perhaps it should check for that. -Bill On Thu, Jan 26, 2023 at 12:17 AM Dave Armstrong <darmst46 at uwo.ca> wrote: > Dear Colleagues, > > I recently answered [this question]() on StackOverflow that identified > what seems to be unusual behaviour with
2023 Aug 20
1
Determining Starting Values for Model Parameters in Nonlinear Regression
...te: > Thank you so much Dr. Nash, I truly appreciate your kind and valuable contribution. > > Cheers, > Paul > > El El s?b, 19 de ago. de 2023 a la(s) 3:35 p.?m., J C Nash <profjcnash at gmail.com <mailto:profjcnash at gmail.com>> escribi?: > > Why bother. nlsr can find a solution from very crude start. > > Mixture <- c(17, 14, 5, 1, 11, 2, 16, 7, 19, 23, 20, 6, 13, 21, 3, 18, 15, 26, 8, 22) > x1 <- c(69.98, 72.5, 77.6, 79.98, 74.98, 80.06, 69.98, 77.34, 69.99, 67.49, 67.51, 77.63, > ? ? ? ? ?72.5, 67.5, 80.1, 69.99, 72.49,...
2017 Feb 17
4
Wish List: Extensions to the derivatives table
The derivative table resides in the function D. In S+ that table is extensible because it is written in the S language. R is faster but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p,
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
Dear friends, Hope you are all doing well and having a great weekend. I have data that was collected on specific gravity and spectrophotometer analysis for 26 mixtures of NG (nitroglycerine), TA (triacetin), and 2 NDPA (2 - nitrodiphenylamine). In the dataset, x1 = %NG, x2 = %TA, and x3 = %2 NDPA. The response variable is the specific gravity, and the rest of the variables are the predictors.
2018 Apr 07
0
Obtain gradient at multiple values for exponential decay model
I have never found the R symbolic differentiation helpful because my functions are typically quite complicated, but was prompted by Steve Ellison's suggestion to try it out in this case: ################# reprex (see reprex package) graphdta <- read.csv( text = "t,c 0,100 40,78 80,59 120,38 160,25 200,21 240,16 280,12 320,10 360,9 400,7 ", header = TRUE ) nd <- c( 100, 250,
2023 Nov 06
1
non-linear regression and root finding
...the Jacobian of the model function cannot be inverted and fails with >> the message "Singular gradient". I wish that R could have a more >> reliable built-in nonlinear least squares solver. (I could also be >> holding it wrong.) Meanwhile, we have excellent CRAN packages nlsr and >> minpack.lm: >> >> minpack.lm::nlsLM( >> ? pHobs ~ pHm(SID, pK1, pK2, pK3), >> ? data.frame(pHobs = pHobs, SID = SID), >> ? start = c(pK1 = pK1, pK2 = pK2, pK3 = pK3), >> ? # the following is also needed to avoid MINPACK failing to fit >> ? lowe...
2023 Nov 06
1
non-linear regression and root finding
...where where crossprod() of the Jacobian of the model function cannot be inverted and fails with the message "Singular gradient". I wish that R could have a more reliable built-in nonlinear least squares solver. (I could also be holding it wrong.) Meanwhile, we have excellent CRAN packages nlsr and minpack.lm: minpack.lm::nlsLM( pHobs ~ pHm(SID, pK1, pK2, pK3), data.frame(pHobs = pHobs, SID = SID), start = c(pK1 = pK1, pK2 = pK2, pK3 = pK3), # the following is also needed to avoid MINPACK failing to fit lower = rep(-1, 3), upper = rep(9, 3) ) # Nonlinear regression model # model:...
2023 Nov 06
2
non-linear regression and root finding
...d() > of the Jacobian of the model function cannot be inverted and fails with > the message "Singular gradient". I wish that R could have a more > reliable built-in nonlinear least squares solver. (I could also be > holding it wrong.) Meanwhile, we have excellent CRAN packages nlsr and > minpack.lm: > > minpack.lm::nlsLM( > pHobs ~ pHm(SID, pK1, pK2, pK3), > data.frame(pHobs = pHobs, SID = SID), > start = c(pK1 = pK1, pK2 = pK2, pK3 = pK3), > # the following is also needed to avoid MINPACK failing to fit > lower = rep(-1, 3), upper = rep(9, 3...
2017 Jun 21
1
fitting cosine curve
..., 16.99, 17.10) t=c(7, 37, 58, 79, 96, 110, 114, 127, 146, 156, 161, 169, 176, 182, 190, 197, 209, 218, 232, 240) lidata <- data.frame(y=y, t=t) #I use the method to fit a curve, but it is different from the real curve, #which can be seen in the figure. linFit <- lm(y ~ cos(t)) library(nlsr) #fullFit <- nls(y ~ A*cos(omega*t+C) + B, #start=list(A=coef(linFit)[1],B=coef(linFit)[2],C=0,omega=.4)) #omega cannot be set to 1, don't know why. fullFit <- nlxb(y ~ A*cos(omega*t+C) + B, data=lidata, start=list(A=coef(linFit)[1],B=coef(linFit)[2],C=0,omega=.04), trace=TRUE) co <-...
2018 Apr 06
3
Obtain gradient at multiple values for exponential decay model
> On Apr 6, 2018, at 8:03 AM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Apr 6, 2018, at 3:43 AM, g l <gnulinux at gmx.com> wrote: >> >>> Sent: Friday, April 06, 2018 at 5:55 AM >>> From: "David Winsemius" <dwinsemius at comcast.net> >>> >>> >>> Not correct. You already have
2023 Aug 21
2
Interpreting Results from LOF.test() from qpcR package
...n from the qpcR package and got the following result: > LOF.test(nlregmod3) $pF [1] 0.97686 $pLR [1] 0.77025 Can I conclude from the LOF.test() results that my nonlinear regression model is significant/statistically significant? Where my nonlinear model was fitted as follows: nlregmod3 <- nlsr(formula=y ~ theta1 - theta2*exp(-theta3*x), data = mod14data2_random, start = list(theta1 = 0.37, theta2 = -exp(-1.8), theta3 = 0.05538)) And the data used to fit this model is the following: dput(mod14data2_random) structure(list(index = c(14L, 27L, 37L,...
2017 Jun 21
1
fitting cosine curve
If you know the period and want to fit phase and amplitude, this is equivalent to fitting a * sin + b * cos > >>> > I don't know how to set the approximate starting values. I'm not sure what you meant by that, but I suspect it's related to phase and amplitude. > >>> > Besides, does the method work for sine curve as well? sin is the same as cos with
2017 Jun 21
0
fitting cosine curve
I'm trying the different parameters, but don't know what the error is: Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates Thanks for any suggestions. On Tue, Jun 20, 2017 at 7:37 PM, Don Cohen <don-r-help at isis.cs3-inc.com> wrote: > > If you know the period and want to fit phase and amplitude, this is > equivalent to
2017 Oct 20
0
nls() and loop
?tryCatch -- Sent from my phone. Please excuse my brevity. On October 20, 2017 7:37:12 AM PDT, Evangelina Viotto <evangelinaviotto at gmail.com> wrote: >Hello I?m need fitt growth curve with data length-age. I want to >evaluate >which is the function that best predicts my data, to do so I compare >the >Akaikes of different models. I'm now need to evaluate if changing the