Skip to content
Back to formatted view

Raw Message

Message-ID: <7a09e3940803051218j27071a72s8af8c075e1d796d0@mail.gmail.com>
Date: 2008-03-05T20:18:28Z
From: Levi Waldron
Subject: differentiating a numeric vector

What functions exist for differentiating a numeric vector (in my case
spectral data)?  That is, experimental data without an analytical
function.  ie,

> x <- seq(1,10,0.1)
> y=x^3+rnorm(length(x),sd=0.01)     #although the real function would be nothing simple like x^3...
> derivy <- ....

I know I could just use diff(y) but it would be nice to estimate
derivatives at the endpoints, calculate higher-order derivatives, and
maybe have some smoothing options ie by differentiating a spline or
something like that.