Baxter-King bandpass filter
Parameters: | X : array-like
low : float
high : float
K : int
|
---|---|
Returns: | Y : array
|
Notes
Returns a centered weighted moving average of the original series. Where the weights a[j] are computed
a[j] = b[j] + theta, for j = 0, +/-1, +/-2, ... +/- K
b[0] = (omega_2 - omega_1)/pi
b[j] = 1/(pi*j)(sin(omega_2*j)-sin(omega_1*j), for j = +/-1, +/-2,...
and theta is a normalizing constant
theta = -sum(b)/(2K+1)
References
Examples
>>> import statsmodels.api as sm
>>> dta = sm.datasets.macrodata.load()
>>> X = dta.data['realinv']
>>> Y = sm.tsa.filters.bkfilter(X, 6, 24, 12)