[R] how to take derivatives of a step function

Eugene Salinas (R) r-eugenesalinas at comcast.net
Fri Jan 23 05:54:19 CET 2004


Hi,

I have estimated a step function and need to take the derivatives of 
this function at all points in the range. Does anyone know of any clever 
ways to do this?

(I have already tried to fit a polynomial through the points in order to 
obtain a smooth representation and then take derivatives of this. Also 
tried to smooth it, and used an SG differentiator. Results are rather 
poor so far, in the sense that you can see from the graph that the 
derivative function is a straight line but I am getting pretty wavy 
things back.)

thanks for any advice, eugene.




More information about the R-help mailing list