Bcoeff computes the complex estimators
$B_{k}(\tau) = \frac{1}{T} \sum_{t=0}^{T-1}R(t+\tau,t)\exp(-i 2 \pi t /T)$
as Fourier coefficients in covariance function representation.
The procedure first computes the periodic mean
(with missing values ignored) and subtracts it from the series.
For each specified lag $\tau$, the values of
$\hat{B}_{k}(\tau)$ are computed only for
$k= 0, 1, \ldots,\left\lfloor T/2 \right\rfloor$,
because for real series
$\hat{B}_{k}(\tau)= \overline{\hat{B}_{T-k}(\tau)}$.
Also the p-values for the test $B_{k}(\tau)=0$ are returned.
The function Bcoeffa calculates the estimator of the real
coefficients $a_{k}(\tau)$ which satisfy
$R(t+\tau,t) = B(t,\tau) = a_1(\tau) + \sum (a_{2k}(\tau) \cos(2 \pi k t/ T)+a_{2k+1}(\tau) \sin(2 \pi k t/ T))$,
for all required lags $\tau$ and $k$.Bcoeff(x, T, tau, missval, datastr,...)
Bcoeffa(x, T, tau, missval, datastr,...)printflg should be a positive parameter to print,
meth is a parameter connected to the amount of frequencies used in estimation, if meth=0 all possible frequencies are used in estimation else
if printflg parameter) print a table containing the following columns:Bcoeff procedure) / real coefficients in representation of coefficient
$B_k(\tau)$ (Bcoeffa procedure).printflg is set to be equal to 0, above values are returned just as matrices.data(volumes)
Bcoeff(volumes,24,seq(0,12),NaN,'volumes')
Bcoeffa(volumes,24,seq(0,12),NaN,'volumes')Run the code above in your browser using DataLab