Hi all,
with a lot more fiddling around, I've come up with this solution:
x <- seq(1, 15, length=100)
y <- jitter(cos(x), a=0.2)
plot(x, y)
findZero <- function(x, y, guess = mean(range(x)), exclusion=
5*diff(range(x))/length(x))
{
interval <- c(guess - exclusion, guess+exc
Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
] On
Behalf Of baptiste auguie
Sent: Friday, August 08, 2008 1:25 PM
To: Hans W. Borchers
Cc: r-help@r-project.org
Subject: Re: [R] re cursive root finding
On 8 Aug 2008, at 16:44, Hans W. Borchers wrote:
As your curve is def
t
Hope this helps,
Ravi.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of baptiste auguie
Sent: Friday, August 08, 2008 1:25 PM
To: Hans W. Borchers
Cc: r-help@r-project.org
Subject: Re: [R] re cursive root finding
On 8 Aug 2008, at 16:44, Hans W. Borchers
On 8 Aug 2008, at 16:44, Hans W. Borchers wrote:
As your curve is defined by its points, I don't see any reason to
artificially apply functions such as 'uniroot' or 'optim' (being a
real overkill in this situation).
I probably agree with this, although the process of using a spline
leaves
As your curve is defined by its points, I don't see any reason to
artificially apply functions such as 'uniroot' or 'optim' (being a
real overkill in this situation).
First smooth the curve with splines, Savitsky-Golay, or Whittacker
smoothing, etc., then loop through the sequence of points an
5 matches
Mail list logo