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
1
vote
1 answer

NlS multiple Gaussian, automatically generate formulas

I have use NLS to fit the Lidar waveform data. It seems work for 3 or 4 peaks. for (i in 1:3){ mean <- c(mean,realind[i]) } sd=runif(3,6,20) c=runif(3,100,250) df<-data.frame(x=seq_along(y),y) fit<-nls(y ~(c1 * exp(-(x -…
1
vote
1 answer

R and nls with functions error - 'must have same number of rows'

I am wanting to find optimum parameters for a function that determines survival from hazard rates (force of mortality). eh <- function(kappa,lambda,time,delay){ FoM <- -log(1-(1-exp(-kappa*(time+delay)))*(exp(-lambda*time))) return(FoM) …
Chris Martin
  • 123
  • 2
  • 9
1
vote
1 answer

nls() in R using entire matrix

I have data which I want to fit to the following equation using R: Z(u,w)=z0*F(w)*[1-exp((-b*u)/F(w))] where z0 and b are constants and F(w), w=0,...,9 is a decreasing step function that depends on w with F(0)=1 and u=1,...,50. Z(u,w) is an observed…
user135174
  • 13
  • 3
1
vote
1 answer

NLS And Log-Periodic Power Law (LPPL) in R

This is the most challenging thing I have done in R so far in that both nls and LPPL are fairly new to me. Below is a portion of script I have been working with. df is a data frame consisting of two columns, Date and Y, which are the closing prices…
mks212
  • 901
  • 1
  • 18
  • 40
1
vote
1 answer

Stat_function range truncated

I am trying to use ggplot2 to plot some data and fitted non-linear curves. I want to use stat_function with nls objects that I have already defined, but the result produces a truncated curve. I have looked at the following pages but so far I…
user2860703
  • 483
  • 5
  • 18
1
vote
1 answer

Why does nls give me an error when called from within ggplot?

I'm trying to fit a sigmoid to some dose-response data. When I use nls outside of ggplot it works fine. When I use it inside geom_smooth, it throws the following error: Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an…
jmainland
  • 43
  • 3
1
vote
0 answers

Using NLS GERMAN shows wrong sorted output(load in chunks) in oracle

[ORACLE DATABASE] After setting, alter session set nls_sort = GERMAN; alter session set nls_language = GERMAN; When loading data in chunks and while using '>' to compare in order to get different sorted chunks shows incorrect data(gives duplicate…
1
vote
0 answers

Customizing nls_sort and nls_comp in Oracle

There is different letters for 'KAF' (ک , ك) and 'YA' (ی , ي) in Persian with different unicode codes and same spell. I am using these commands to set Persian sort and comparing in my project ALTER SESSION SET nls_sort=persian; ALTER SESSION SET…
Nik Kashi
  • 4,447
  • 3
  • 40
  • 63
1
vote
1 answer

Error with created function using nls and ssLogis

I'm trying to write a function for fitting a logistic curve using nls with the self-starting option ssLogis. I've got some data - which will actually come as a data frame, so this first step is really just to get a similar data set-up to what I'll…
user2581681
  • 35
  • 1
  • 4
1
vote
1 answer

R nls to fit custom gompertz curve

I'm trying to fit my data to a user defined Gompertz equation. However, I received an error as follows: Error in nls(Eq, data = GPdata, start = list(K = 1), algorithm = "default", : singular gradient I know this probably means my starting…
crazian
  • 649
  • 4
  • 12
  • 24
1
vote
1 answer

Plot a smooth and extrapolated curve using an nls model with several fitted parameters

I feel that I am close to finding the answer for my problem, but somehow I just cannot manage to do it. I have used nls function to fit 3 parameters using a rather complicated function describing fertilization success of eggs (y-axis) in a range of…
Mikko
  • 7,530
  • 8
  • 55
  • 92
1
vote
1 answer

nls line of best fit - how to force plotting of line?

I am trying to write a basic function to add some lines of best fit to plots using nls. This works fine unless the data just happens to be defined exactly by the formula passed to nls. I'm aware of the issues and that this is documented behaviour as…
thelatemail
  • 91,185
  • 12
  • 128
  • 188
1
vote
1 answer

nlsBoot and foreach %dopar%: scoping issues

I would like to do bootstrap of residuals for nls fits in a loop. I use nlsBoot and in order to decrease computation time I would like to do that in parallel (on a Windows 7 system at the moment). Here is some code, which reproduces my…
Roland
  • 127,288
  • 10
  • 191
  • 288
1
vote
1 answer

R Nonlinear Least Squares (nls) Model Fitting

I'm trying to fit the information from the G function of my data to the following mathematical mode: y = A / ((1 + (B^2)*(x^2))^((C+1)/2)) . The shape of this graph can be seen…
MikeZ
  • 345
  • 1
  • 4
  • 15
0
votes
1 answer

NLS missing message: Obsolete_attribute_name___ERROR_ in:

From some bitter, bitter experience I am on a mission to get my MyEclipse "warnings" to 0. One is NLS missing message: Obsolete_attribute_name___ERROR_ in: org.eclipse.wst.html.core.internal.HTMLCorePluginResources deleteAuthorities.jsp …
Ribeye
  • 2,137
  • 3
  • 18
  • 25