The central difference is a method to approximate numerically the derivative of a function sampled at discrete intervals. In R, one would do:
n<-100
y<-cumsum(rnorm(n))
y_p[1]<-diff(y[1:2])
for(i in 2:(n-1)) y_p[i]<-diff(y[c(i-1,i+1)])/2
y_p[n]<-diff(y[c(n-1,n)])
My question is, what is the comonly accepted inverse to this operator? (preferably in pseudo code form to avoid ambuiguity)
Best,