Calculates left side derative of time series of input order.
Generate left side derative of a ts of input orders.
Parameters:  ts : TimeSeries
order : int


Returns:  result : vtools.data.time_series.TimeSeries

uility to compute ts norm (L_1,L_2,L_inf).
compute L1 difference of two input time series.
Parameters:  ts1,ts2 : TimeSeries
time_window : time_window ,optional


Returns:  result : float

compute L2 difference of two input time series.
Parameters:  ts1,ts2 : TimeSeries
time_window : time_window,optional


Returns:  result : float

compute L_inf difference of two input time series.
Parameters:  ts1,ts2: :class:`~vtools.data.timeseries.TimeSeries` :
time_window : time_window,optional


Returns:  result : float

compare two ts by absolute difference.
Parameters:  ts1.ts2 : TimeSeries
time_window : time_window,optional
tol :float,optional :


Returns:  result : bool

compare two ts by absolute difference.
Parameters:  ts1,ts2 : TimeSeries
time_window : time_window,optional
tol :float,optional :


Returns:  result : bool

Module contains filter used in tidal time series analysis.
lowpass butterworth filter using moving average.
Parameters:  ts1 : TimeSeries
before : time_interval, int
after : time_interval, int


Returns:  result : TimeSeries

lowpass butterworthsquared filter on a regular time series.
Parameters:  ts : TimeSeries
order: int ,optional :
cutoff_frequency: float,optional :
cutoff_period : string or time_interval


Returns:  result : TimeSeries

Classic moving average over 24 hours.
Parameters:  ts : TimeSeries


Returns:  result : TimeSeries

Godin filtering method on a regular time series.
Parameters:  ts : TimeSeries


Returns:  result : TimeSeries

squared lowpass cosine lanczos filter on a regular time series.
Parameters:  ts : TimeSeries
filter_len : int, time_interval
cutoff_frequency: float,optional :
cutoff_period : string or time_interval


Returns:  result : TimeSeries

For test purpose only
wrapper of scipy gaussian_filter.
Parameters:  ts: :class:`~vtools.data.timeseries.TimeSeries` :
sigma: int or :ref:`time_interval<time_intervals>` :
order: int,optional :
mode : {‘reflect’, ‘constant’, ‘nearest’, ‘mirror’, ‘wrap’}, optional
cval : scalar, optional


Returns:  result : TimeSeries

Some data interpolating over gaps within a time series.
Interpolate a time series by linear interpolation.
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan : boolean, optional


Returns:  result : TimeSeries

Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan : boolean,optional
s : float, optional


Returns:  result : TimeSeries

Interpolation by monotonicity (shape) preserving spline. The spline will fit the data points exactly, derivatives are subject to slope limiters. The name ‘monotonicitypreserving’ can be a little deceptive – this is an excellent all around choice for interpolating continuous data.
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan: if nan points should be omitted or not. : 

Returns:  result : TimeSeries

Interpolating series using nearest valid neighbor.
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan : boolean, optional


Returns:  result : TimeSeries A regular time series if second input is time interval, :

Interpolate at time series using value at the previous valid neighbor
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan : boolean,optional


Returns:  result : TimeSeries A regular time series if second input is time interval, :

Interpolate by next (forward in time) valid neighbors.
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
filter_nan : boolean,optional


Returns:  result : TimeSeries

Estimate missing values within a time series by interpolation.
Parameters:  ts : TimeSeries
method : {LINEAR,NEAREST,PREVIOUS,NEXT,SPLINE,MSPLINE,RHIST}
max_gap: int,optional :
**args : dictonary


Returns:  filled : TimeSeries

Interpolate a time series to a new time sequence.
Parameters:  ts : TimeSeries
times : time_interval or time_sequence
method : string, optional
filter_nan : boolean, optional
**dic : dictonary


Returns:  result : TimeSeries

See also
Interpolating a regular time series (rts) to a finer rts by rational histospline.
The rational histospline preserves area under the curve. This is a good choice of spline for period averaged data where an interpolant is desired that is ‘conservative’. Note that it is the underlying continuous interpolant that will be ‘conservative though, not the returned discrete time series which merely samples the underlying interpolant.
Parameters:  ts : TimeSeries
interval : time_interval p : float, optional
lowbound : float, optional
tolbound : float, optional


Returns:  result : TimeSeries

Merge multiple time series ts1,ts2 ..., a new time series with combination of ts1,ts2 data will be returned.
merge a number of timeseries together and return a new ts.
Parameters:  ts0 : TimeSeries
ts1 : TimeSeries
*other_ts : TimeSeries


Returns:  merged : TimeSeries

Period operation over a regular time series, the returned new time series are aligned with operation interval( e.g. monthly data will start on the first day of the month).
Apply a period operation on a time series.
Note
Only valid data of input ‘ts’ will be considered. The ‘method’ input is only meaningful for averaging operation, if not given, function will select one method based on the timestamp property of time seris.
Parameters:  ts : TimeSeries


Returns:  Result : TimeSeries

Raises:  error : ValueError

Find a period minimum values on a time series.
Parameters:  ts : TimeSeries
interval : time_interval


Returns:  Result : TimeSeries

Raises:  error : ValueError

Find a period maximum on a time series.
Parameters:  ts : TimeSeries
interval : time_interval


Returns:  Result : TimeSeries

Raises:  error : ValueError

Find a period mean on a time series.
Parameters:  ts : TimeSeries
interval : time_interval


Returns:  Result : TimeSeries

Raises:  error : ValueError

Find a period sum on a time series.
Parameters:  ts : TimeSeries
interval : time_interval


Returns:  Result : TimeSeries

Raises:  error : ValueError

Resample operation over a time series, a new time series with the desired interval and corresponding ticks will be returned.
Do a resampling operation on a time series.
Parameters:  ts : TimeSeries
interval : time_interval
aligned: boolean :


Returns:  Resampled : TimeSeries

Raises:  error : ValueError

Parameters:  ts : TimeSeries
interval : time_interval
**dic : Dictionary


Returns:  Resampled : TimeSeries

Module for data interpolation using rational histosplines. The main algorithm is a numpy reimplementation of rhist2 in
One Dimensional Spline Interpolation Algorithms by Helmuth Spath (1995).
The benefit of histosplines is that they are designed to conserve the integral under the curve, and so they are good for period averaged data when you want the interpolator to conserve mass.
Histopline for arrays with tension. Based by an algorithm rhist2 in One Dimensional Spline Interpolation Algorithms by Helmuth Spath (1995).
Parameters:  x : arraylike
y : arraylike, dimension (n1)
xnew : arraylike
y0,yn : float
p,q: arraylike, dimension (n1) :
Returns : —— : ynew : arraylike


Histopline for arrays with lower bound enforcement. This routine drives rhist() but tests that the output array observes the lower bound and adapts the tension parameters as needed.
This will not work exactly if the input array has values right on the lower bound. In this case, the parameter floor_eps allows you to specify a tolerance of bound violation to shoot for ... and if it isn’t met in maxiter iterations the value is simply floored.
Parameters:  x : arraylike
y : arraylike, dimension (n1)
xnew : arraylike
y0,yn : float
p: float :
lbound: float :
maxiter : integer
pfactor : float
floor_eps : float


Returns:  ynew : arraylike

Routine that produces coefficients for the histospline
Evaluate a histospline at new x points
a is the lower band (with leading zero) b is the center diagonal (length == nrow) c is upper band (trailing zero) d is right hand side
Shift operations over a time series, original time series with shifted start_time,end_time and times is return.
Shift entire time series by a given interval
Parameters:  ts : TimeSeries
interval : time_interval


Returns:  shifted : TimeSeries

Calculate lag of the second time series b, that maximizes the crosscorrelation with a.
Parameters:  a,b : vtools.data.timeseries.Timeseries
time_window : time_window
max_shift : interval
period : interval, optional


Returns:  lag : datetime.timedelta

Calculates the correlation coefficient (the ‘r’ in ‘squared’ between two series.
For time series where the targets are serially correlated and may span only a fraction of the natural variability, this statistic may not be appropriate and Murphy (1988) explains why caution should be exercised in using this statistic.
Parameters:  predictions, targets : array_like
bias : boolean


Returns:  r : float

Calculate the median error, discounting nan values
Parameters:  predictions, targets : array_like


Returns:  med : float

Mean squared error
Parameters:  predictions, targets : array_like


Returns:  mse : vtools.data.timeseries.TimeSeries

Root mean squared error
Parameters:  predictions, targets : array_like


Returns:  mse : float

Calculate a NashSutcliffelike skill score based on mean squared error
As per the discussion in Murphy (1988) other reference forecasts (climatology, harmonic tide, etc.) are possible.
Parameters:  predictions, targets : array_like


Returns:  rmse : float

Calculate the (possibly trimmed) mean error, discounting nan values
Parameters:  predictions, targets : array_like
limits : tuple(float)
inclusive : [boolean, boolean]


Returns:  mean : float

Decorator used to ensure that functions can be used on time series or arrays
Apply ufunc.accumulate to the data and produce a neatened time series The function will be applied cumulatively to the data. So... ts_apply(ts, add) will produce a time series, where each entry is the cumulative sum up to that index.
Apply a numpy ufunc to the data and produce a neatened time series The function will be applied pointwise to the data. The argument other must be a scalar and serves as the second argument to a binary operator or function.
So... ts_apply(ts, add, 5) will add 5 to every data member
Return the global (scalar) maximum value of ts
Return the pointwise maximum of the ts and a scalar or another time series
todo: figure out time weight
Return the global (scalar) minimum value of ts
Return the pointwise minimum of the ts and a scalar
Reduce the data by applying ufunc.reduce and produce a neatened time series The function will be applied cumulatively to the data, producing a “total”. The output of ts_reduce is the same as the size of one element in the time series. So... ts_reduce(ts, add) will produce the sum of a time series. Some convenience functions such as ts_sum, ts_mean, ts_max, ts_min are provided that rely on this function.
Return the sum of the time series from start to end todo: figure out time weights, figure out trapezoidal part