N <- 100
x <- cumsum(rexp(N))
smooth_cumulative <- smooth.spline(x, 1:length(x), df=5)
rate_smooth <- predict(smooth_cumulative, 0 : (N-1)), deriv=1)
plot(rate_smooth, type="l", col="blue", lwd=2)
N <- 100
x <- cumsum(rexp(N))
smooth_cumulative <- smooth.spline(x, 1:length(x), df=5)
rate_smooth <- predict(smooth_cumulative, 0 : (N-1)), deriv=1)
plot(rate_smooth, type="l", col="blue", lwd=2)
You'll need to experiment with the degrees of freedom in the smoother.