Dear all
Since I did not receive any answer to my general question (?),
let me ask a concrete question:
How can I fit the simple function y = a*sin(x)/b*x?
This is the code that I tried, but nls gives an error:
x - seq(1,10,0.1)
y - sin(x)/x
plot(x,y)
z - jitter(y,amount=0.1)
plot(x,z)
df -
You didn't tell us what the error message nls gave, but it should
be obvious: You can estimate either a or b in this model (or their
ratio), but you can't estimate both. See any good book on nonlinear
regression, e.g., Bates and Watts (1988) Nonlinear Regression and Its
Applications
] Robust nonlinear regression - sin(x)/x?
Dear all
Since I did not receive any answer to my general question (?),
let me ask a concrete question:
How can I fit the simple function y = a*sin(x)/b*x?
This is the code that I tried, but nls gives an error:
x - seq(1,10,0.1)
y - sin(x)/x
plot
cstrato [EMAIL PROTECTED] writes:
Dear all
Since I did not receive any answer to my general question (?),
let me ask a concrete question:
How can I fit the simple function y = a*sin(x)/b*x?
This is the code that I tried, but nls gives an error:
x - seq(1,10,0.1)
y - sin(x)/x
]
Date: Monday, February 2, 2004 2:28 pm
Subject: [R] Robust nonlinear regression - sin(x)/x?
Dear all
Since I did not receive any answer to my general question (?),
let me ask a concrete question:
How can I fit the simple function y = a*sin(x)/b*x?
This is the code that I tried
Dear all
Thank you very much this time for the fast response and
your many comments, and sorry for the stupid mistake.
1, The following gives the following error:
nf - nls(z ~ a*sin(x)/(b*x), data=df,
start=list(a=0.8,b=0.9), trace = TRUE)
Error in nlsModel(formula, mf, start) :
, 2004 2:28 pm
Subject: [R] Robust nonlinear regression - sin(x)/x?
Dear all
Since I did not receive any answer to my general question (?),
let me ask a concrete question:
How can I fit the simple function y = a*sin(x)/b*x?
This is the code that I tried, but nls gives an error:
x - seq(1,10,0.1
Dear all
Here is a hopefully better example with regards to
nonlinear robust fitting:
# fitting a polynomial:
x - seq(-10,10,0.2)
y - 10*x + 4*x*x - 2*x*x*x
plot(x,y)
z - jitter(y,amount=300)
plot(x,z)
df - as.data.frame(cbind(x,z))
nf - nls(z ~ a*x + b*x*x + c*x*x*x, data=df,
+
1. The question of linear vs. nonlinear means linear in the
parameters to be estimated. All the examples you have given so far are
linear in the parameters to be estimated. The fact that they are
nonlinear in x is immaterial.
2. With this hint and the posting guide
Dear R experts
This is a general question:
Does R have functions for nonlinear robust regression,
analogous to e.g. LTS?
Searching google I have found
1, an abstract to generalize LTS for nonlinear regression
models, see: http://smealsearch.psu.edu/1509.html
2, an AD-model builder, see:
10 matches
Mail list logo