I have a question on gretl and how I can compute the filter of moving avarage.
I have a time series and I want to calculate the weighted moving avarage centered in 5 with these weights: 0.15, 0.2, 0.3, 0.2, 0.15.
In the main page of gretl we have the Variabile window where I can select Filter but there's no option for what I want to do, only, for example, simple moving avarage.
In R I would do something like this:
c<-as.vector()
for (in in 3:(T-2)){
c<-rbind(c, 0.15*x[i-2]+0.2*x[i-1]+0.3*x[i]+0.2*x[i+1]+0.15*x[i+2]}
where x is my time seriee and T is the number of observations.
But my questions are:
- Does it exist an user-friendly way to do it in gretl?
- If not, what is the best way to do it in the console? Does it exist a specific function?