correlations using exponential smoothing
Posted: Tue Feb 14, 2012 9:48 am
Hi there,
I would like to compute correlations using exponential smoothing so that the most recent observations have more weight.
More specifically, if the expected value using equal weights p1,p2,...pk for a random variable X can be calculated as:
E(X) = p_1*x_1 + p_2*x_2 + ... + p_k*x_k
I would like to give different weights to each observation so that I would calculated the expected value as:
E(X) = a*x_t + a(1-a)*x_t-1 + a(1-a)(1-a)*x_t-2 ... + a(1-a)...(1-a)*x_t-k
The last weight is a*[(1-a) to the k]
I intend to calculate the correlations recursively where the sample used keeps increasing as time goes by.
What would be the best way to accomplish this in Eviews 7.2 ?
I tought to create a series where each observation is a weight value (a, a(1-a), a(1-a) to the 2, ...) and multiple the variables I want to calculate the correlations by this series beforehand. Would this be a good approach?
Thanks for any sugestions,
Mara
I would like to compute correlations using exponential smoothing so that the most recent observations have more weight.
More specifically, if the expected value using equal weights p1,p2,...pk for a random variable X can be calculated as:
E(X) = p_1*x_1 + p_2*x_2 + ... + p_k*x_k
I would like to give different weights to each observation so that I would calculated the expected value as:
E(X) = a*x_t + a(1-a)*x_t-1 + a(1-a)(1-a)*x_t-2 ... + a(1-a)...(1-a)*x_t-k
The last weight is a*[(1-a) to the k]
I intend to calculate the correlations recursively where the sample used keeps increasing as time goes by.
What would be the best way to accomplish this in Eviews 7.2 ?
I tought to create a series where each observation is a weight value (a, a(1-a), a(1-a) to the 2, ...) and multiple the variables I want to calculate the correlations by this series beforehand. Would this be a good approach?
Thanks for any sugestions,
Mara