Questions tagged [nls]

nls refers to nonlinear least-squares and is a function in R that allows to estimate the parameters of a nonlinear model.

nls should not be confused with nls-lang which is an environment variable for Oracle databases.

670 questions
28
votes
5 answers

NLS_LANG setting for JDBC thin driver?

I am using the thin Oracle JDBC driver ver 10.2.0 (ojdbc14.jar). I would like to configure its NLS_LANG setting manually. Is there a way? Currently it fetches this setting from the VM variable user.language (which is set automatically by setting the…
dasp
  • 909
  • 4
  • 13
  • 21
24
votes
2 answers

How to handle boundary constraints when using `nls.lm` in R

I asked this question a while ago. I am not sure whether I should post this as an answer or a new question. I do not have an answer but I "solved" the problem by applying the Levenberg-Marquardt algorithm using nls.lm in R and when the solution is…
Zhenglei
  • 988
  • 1
  • 10
  • 21
16
votes
3 answers

Showing equation of nls model with ggpmisc

R package ggpmisc can be used to show equation of lm model and poly model on ggplot2 (See here for reference). I wonder how I could show nls model equation results on ggplot2 using ggpmisc. Below is my MWE. library(ggpmisc) args <- list(formula = y…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
14
votes
3 answers

nls troubles: Missing value or an infinity produced when evaluating the model

I am an R newbie trying to fit plant photosynthetic light response curves (saturating, curvilinear) to a particular model accepted by experts. The goal is to get estimated coefficient values for Am, Rd, and LCP. Here is the error I keep…
Plantapus
  • 153
  • 1
  • 1
  • 6
14
votes
3 answers

Fitting a function in R

I have a few datapoints (x and y) that seem to have a logarithmic relationship. > mydata x y 1 0 123 2 2 116 3 4 113 4 15 100 5 48 87 6 75 84 7 122 77 > qplot(x, y, data=mydata, geom="line") Now I would like to find an…
jnns
  • 5,148
  • 4
  • 47
  • 74
11
votes
11 answers

ORA-00604 ORA-12705

I am having this error in my j2ee web application. java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-12705: Cannot access NLS data files or invalid environment specified …
cedric
  • 3,107
  • 15
  • 54
  • 65
9
votes
2 answers

Azure App Service seems to have NLS enabled in .NET 5 mode

After spending countless of hours on getting to the core of a bug, I eventually boiled down a problem to the use of string.Compare with StringComparison.InvariantCultureIgnoreCase in .NET 5. Consider the following two dotnetfiddles: .NET 4.7.2:…
Lennard Fonteijn
  • 2,561
  • 2
  • 24
  • 39
9
votes
2 answers

How to calculate confidence intervals for Nonlinear Least Squares in r?

I'm having some trouble to predict confidence intervals ros an nls in r. pl <- ggplot(data) + geom_point(aes(x=date, y=cases),size=2, colour="black") + xlab("Date") + ylab("Cases") model = nls(cases ~ SSlogis(log(date), Asym, xmid, scal), data=…
A Jorg
  • 141
  • 1
  • 5
9
votes
2 answers

Do a nonlinear least square (nls) fit for a sinusoidal model

I want to fit the following function to my data: f(x) = Offset+Amplitudesin(FrequencyT+Phase), or according to Wikipedia: f(x) = C+alphasin(omegaT+phi) my data is stored in a file in two columns, and I import them by the…
jacky_ramone
  • 93
  • 1
  • 5
9
votes
2 answers

R nls singular gradient

I've tried searching the other threads on this topic but none of the fixes are working for me. I have the results of a natural experiment and I want to show the number of consecutive occurrences of an event fit an exponential distribution. My R…
sessmurda
  • 167
  • 1
  • 2
  • 8
8
votes
2 answers

R: minpack.lm::nls.lm failed with good results

I use nls.lm from the minpack.lm package to fit a lot of non linear models. It often fails after 20 iterations because of a singular gradient matrix at initial parameter estimates. The problem is when I have a look at the iterations before failling…
user3904098
8
votes
3 answers

Dojo 1.9 build 'multipleDefine' error while loading locale

My dojo application breaks after building, during loading the app, throwing 'multipleDefine' and giving this error: Error {src: "dojoLoader", info: Object} Message: multipleDefine info: Object {pid: "dojo", mid: "dojo/nls/dojo_en-us", pack:…
nvd_ai
  • 1,060
  • 11
  • 20
8
votes
4 answers

Number and date format : altering NLS_SESSION_PARAMETER does not work?

Oracle 11.2.0.3.0, APEX 4.1.1.00.23. We need to display numbers in our application with the format FM999999999990.000 and dates with the English format DD-MON-YYYY. Even if the application language is going to change (french, spain, etc.), we always…
Yann39
  • 14,285
  • 11
  • 56
  • 84
7
votes
3 answers

How to find good start values for nls function?

I don't understand why I can't have a nls function for these data. I have tried with a lot of different start values and I have always the same error. Here is what I have been doing: expFct2 = function (x, a, b,c) { a*(1-exp(-x/b)) + c } vec_x…
Tali
  • 711
  • 3
  • 8
  • 15
7
votes
1 answer

Curve fitting in R using nls

I'm trying to fit a curve over (the tail of) the following data: [1] 1 1 1 1 1 1 2 1 2 2 3 2 1 1 4 3 2 11 6 2 16 7 17 36 [25] 27 39 41 33 42 66 92 138 189 249 665 224 309 247 641 777 671 532 749…
Pieter
  • 3,339
  • 5
  • 30
  • 63
1
2 3
44 45