# EWXCF - Exponential-Weighted Correlation

Computes the correlation factor using the exponential-weighted correlation function (i.e., using the exponential-weighted covariance (EWCOV) and volatility (EWMA/EWV) method).

## Syntax

EWXCF(X, Y, Order, Lambda, T)

X
is the first univariate time series data (a one-dimensional array of cells (e.g., rows or columns)).
Y
is the second univariate time series data (a one-dimensional array of cells (e.g., rows or columns)).
Order
is the time order in the data series (i.e., whether the first data point corresponds to the earliest or latest date (earliest date = 1 (default), latest date = 0)).
Order Description
1 Ascending (the first data point corresponds to the earliest date) (default).
0 Descending (the first data point corresponds to the latest date).
Lambda
is the smoothing parameter used for the exponential-weighting scheme. If missing, the default value of 0.94 is assumed.
T
is the forecast time/horizon (expressed in terms of steps beyond the end of the time series X). If missing, the default value of 1 is assumed.

## Remarks

1. The time series is homogeneous or equally spaced.
2. The two time series must have identical sizes and time orders.
3. The correlation is defined as: $$\rho^{(xy)}_t=\frac{\sigma_t^{(xy)}}{{_x\sigma_t}\times{_y\sigma_t}}$$ $$\sigma_t^{(xy)} = \lambda\sigma_{t-1}^{(xy)}+(1-\lambda)x_{t-1}y_{t-1}$$ $$_x\sigma_t^2=\lambda\times{_x\sigma_{t-1}^2}+(1-\lambda)x_{t-1}^2$$ $$_y\sigma_t^2=\lambda\times{_y\sigma_{t-1}^2}+(1-\lambda)y_{t-1}^2$$ Where:
• $\rho^{(xy)}_t$ is the sample correlation between X and Y at time $t$.
• $\sigma_t^{(xy)}$ is the sample exponential-weighted covariance between X and Y at time $t$.
• $_x\sigma_t$ is the sample exponential-weighted volatility for the time series X at time $t$.
• $_y\sigma_t$ is the sample exponential-weighted volatility for the time series Y at time $t$.
• $\lambda$ is the smoothing factor used in the exponential-weighted volatility and covariance calculations.
4. If the input data sets do not have a zero mean, the EWXCF Excel function removes the mean from each sample data on your behalf.
5. The EWXCF uses the EWMA volatility and EWCOV representations which do not assume a long-run average volatility (or covariance), and thus, for any forecast horizon beyond one-step, the EWXCF returns a constant value.