calculate delta changes in times series (monthly)
9 views (last 30 days)
I have a time series of lake level heights over time.
It looks like this:
... and so on for 25 years.
Unfortunately my intervals aren't whole months. Sometimes I have like something beween 1-2 months between two measurements. But in the end I want to calculate the monthly lake level change. In other words: dh/dt where dt = 1 month.
I was thinking of calculating the interval between the first and last measurement what gives me a total of 290 months. So in the end I should have 290 dt's. Then I think I have to interpolate between the values to obtain maybe a value for every day to finally calculate monthly dt's. There my Matlab skills end. I hope someone can help me out with this.
KSSV on 22 Feb 2018
YOu create the dates you want and do interpolation using interp1, to get the data for each day. Check this example:
T1 = datetime(datestr('1992/10/21'));
T2 = datetime(datestr('1993/10/26')) ;
T = (T1:T2)';
data = rand(size(T)) ;
% make some data missing / This is the original data
idx = randperm(length(T),100) ;
X = T ; Y = data ;
X(idx) =  ;
Y(idx) =  ;
% Do inteprolation
Yi = interp1(X,Y,T) ;