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.
Bill.Venables@csiro.au
2004-Jan-23 06:09 UTC
[R] how to take derivatives of a step function
It might be helpful to know just why you want to do this. Just because one function is a smooth approximation to another doesn't imply anything about the derivatives approximating each other, (well, not much). The GENERALIZED derivative of a step function can be written down explicitly as the weighted sum of dirac delta functions - in other words it's zero 'almost everywhere' but goes crazy at the steps. Bill Venables. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Eugene Salinas (R) Sent: Friday, 23 January 2004 2:54 PM To: r-help at stat.math.ethz.ch Subject: [R] how to take derivatives of a step function 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. ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html