Returns the long-run variance using a Bartlett kernel with window size k.
Syntax
LRVar(X, k)
- X
- is the input data sample (a one-dimensional array of cells (e.g., rows or columns)).
- k
- is the input Bartlett kernel window size. If omitted, the default value is the cubic root of the sample data size.
Remarks
- The input time series data may include missing values (e.g., #N/A, #VALUE!, #NUM!, empty cell), but they will not be included in the calculations.
- The long-run variance is computed as follows:
$$\sigma^2=\frac{1}{T}\sum_{t=k}^{T-k}\sum_{i=-k}^k w_i(x_t-\bar{x})(x_{t-i}-\bar{x})$$
Where:
- $x_{t} \in X$ is a value from the input time series data.
- $\bar{x}$ is the mean of the input time series data.
- The weight ($w_i$) in Bartlett kernel is defined as follows:
$$w_i= 1- \frac{\left | i \right |}{k+1}$$ - $k$ is the input window size for the Bartlett kernel.
Files Examples
Related Links
References
- Hamilton, J .D.; Time Series Analysis, Princeton University Press (1994), ISBN 0-691-04289-6.
- Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740.
Comments
Article is closed for comments.