How to calculate the first time series derivative

I would calculate the first derivative (dpH / dtime) of the time series using two variables, timeand pH.

Are there any functions for this in R, or should I calculate an extra function for this?

+13
source share
3 answers

Assuming that pHu timeare simple vectors, try this:

library(pspline)
predict(sm.spline(time, pH), time, 1)
+16
source

You might want to start with, stats::derivor diff.ts, as Matt L. suggested. Just keep in mind that my teacher told all his students: digital differentiation is known as the “error multiplier.”

EDIT: , , , . , , - . , . , predict.spline. , , , , , .

+9

All Articles