Movingaverages

更新时间:2023-06-09 13:50:44 阅读: 评论:0

Moving averages
Rob J Hyndman
November8,2009
锻炼的最佳时间A moving average is a time ries constructed by taking averages of veral quential values of another time ries.It is a type of mathematical convolution.If we reprent the original time ries by y1,...,y n,then a two-sided moving average of the time ries is given by
z t=
1
2k+1
k
j=−k
y t+j,t=k+1,k+2,...,n−k.
Thus z k+1,...,z n−k forms a new time ries which is bad on averages of the original time ries, {y t}.Similarly,a one-sided moving average of{y t}is given by
z t=
1
k+1
k
j=0宝宝出生
y t−j,t=k+1,k+2,...,n.
More generally,weighted averages may also be ud.Moving averages are also called running means or rolling averages.They are a special ca of“filtering”,which is a general process that takes one time ries and transforms it into another time ries.
The term“moving average”is ud to describe this procedure becau each average is computed by
dropping the oldest obrvation and including the next obrvation.The averaging “moves”through the time ries until z t is computed at each obrvation for which all elements of the average are available.
Note that in the above examples,the number of data points in each average remains constant. Variations on moving averages allow the number of points in each average to change.For example,in a cumulative average,each value of the new ries is equal to the sum of all previous values.
Moving averages are ud in two main ways:Two-sided(weighted)moving averages are ud to“smooth”a time ries in order to estimate or highlight the underlying trend;one-sided (weighted)moving averages are ud as simple forecasting methods for time ries.While moving averages are very simple methods,they are often building blocks for more complicated methods of time ries smoothing,decomposition and forecasting.
1Smoothing using two-sided moving averages
It is common for a time ries to consist of a smooth underlying trend obrved with error:
y t=f(t)+εt,
where f(t)is a smooth and continuous function of t and{εt}is a zero-mean error ries.The estimation of f(t)is known as smoothing,and a two-sided moving average is one way of doing
so:
ˆf(t)=1
王菲陈奕迅2k+1
k
j=−k
y t+j,t=k+1,k+2,...,n−k.
The idea behind using moving averages for smoothing is that obrvations which are nearby in time are also likely to be clo in value.So taking an average of the points near an obrvation will provide a reasonable estimate of the trend at that obrvation.The average eliminates some of the randomness in the data,leaving a smooth trend component.
Moving averages do not allow estimates of f(t)near the ends of the time ries(in thefirst k and last k periods).This can cau difficulties when the trend estimate is ud for forecasting or analysing the most recent data.
Each average consists of2k+1obrvations.Sometimes this is known as a(2k+1)MA smoother.The larger the value of k,theflatter and smoother the estimate of f(t)will be.A smooth estimate is usually desirable,but aflat estimate is biad,especially near the peaks and troughs in f(t).When{εt}is a white noi ,independent and identically distributed with zero mean and varianceσ2),the bias is given by E[ˆf(x)]−f(x)≈16f  (x)k(k+1)and the variance by V[ˆf(x)]≈σ2/(2k+1).So there is a trade-offbetween increasing bias(with large k) and increasing variance(with small k).
2Centered moving averages
The simple moving average described above requires an odd number of obrvations to be included in each average.This ensures that the average is centered at the middle of the data values being averaged.But suppo we wish to calculate a moving average with an even number of obrvations.For example,to calculate a4-term moving average,the trend at time t could be calculated as
ˆf(t−0.5)=(y
t−2+y t−1+y t+y t+1)/4
orˆf(t+0.5)=(y t−1+y t+y t+1+y t+2)/4.
That is,we could include two terms on the left and one on the right of the obrvation,or one term on the left and two terms on the right,and neither of the is centered on t.If we now take the average of the two moving averages,we obtain something centered at time t:
ˆf(t)=1
2[(y t−2+y t−1+y t+y t+1)/4]+1
2
[(y t−1+y t+y t+1+y t+2)/4]
=1
8y t−2+1
4
y t−1+1
4
y t+1
4
y t+11
8
天天军棋
y t+2.
So a4MA followed by a2MA gives a centered moving average,sometimes written as2×4 MA.This is also a weighted moving average of order5,where the weights for each period are unequal.In general,a2×m MA smoother is equivalent to a weighted MA of order m+1with weights1/m for all obrvations except for thefirst and last obrvations in the average,which have weights1/(2m).
英国贵族女孩名字
Centered moving averages are examples of how a moving average can itlf be smoothed by another moving average.Together,the smoother is known as a double moving average.In fact, any combination of moving averages can be ud together to form a double moving average.For example,a3×3moving average is a3MA of a3MA.
3Moving averages with asonal data
If the centered4MA was ud with quarterly data,each quarter would be given equal weight. The weight for the quarter at the ends of the moving average is split between the two years.It is this property that makes2×4MA very uful for estimating a trend in the prence of quarterly asonality.The asonal variation will be averaged out exactly when the moving average is computed.A slightly longer or a slightly shorter moving average will still retain some asonal
variation.An alternative to a2×4MA for quarterly data is a2×8MA or2×12MA,which will also give equal weights to all quarters and produce a smootherfit than the2×4MA.Other moving averages tend to be contaminated by the asonal variation.
More generally,a2×(km)MA can be ud with data with asonality of length m where k is a small positive integer(usually1or2).For example,a2×24MA may be ud for estimating a trend in monthly s
easonal data(where m=12).
4Weighted moving averages
A weighted k-point moving average can be written as
ˆf(t)=
k
j=−k
a j y t+j.
For the weighted moving average to work properly,it is important that the weights sum to one and that they are symmetric,that is a j=a−j.However,we do not require that the weights are between0and1.The advantage of weighted averages is that the resulting trend estimate is much smoother.Instead of obrvations entering and leaving the average abruptly,they can be slowly downweighted.There are many schemes for lecting appropriate weights.Kendall et al. (1983,chapter46)give details.
Some ts of weights are widely ud and have been named after their propors.For example,Spencer(1904)propod a5×4×4MA followed by a weighted5-term moving average with weights a0=1,a1=a−1=3/4,and a2=a−2=−3/4.The values are not chon arbitrarily, but becau the resulting combination of moving averages can be shown to have desirable mathematical properties.In this ca,any cubic polynomial will be undistorted by the averaging process.It can be shown that Spencer’s MA is equivalent to the15-point weighted moving average who weights are−.009,−.019,−.016,.009,.066,.144,.209,.231,.209,.144,.066,.009,−.016,−.019,and−.009.Another Spencer’s MA that is commonly ud is the21-point weighted moving average.Henderson’s weighted moving averages are also widely ud,especially as part of asonal adjustment methods(Ladiray&Quenneville2001).The t of weights is known as the weight function.Table1shows some common weight functions.The are all symmetric,so a−j=a j.
Table1:Weight functions a j for some common weighted moving averages.
Name a0a1a2a3a4a5a6a7a8a9a10a11
3MA.333.333
5MA.200.200.200
2×12MA.083.083.083.083.083.083.042
3×3MA.333.222.111
3×5MA.200.200.133.067
S15MA.231.209.144.066.009−.016−.019−.009
S21MA.171.163.134.037.051.017−.006−.014−.014−.009−.003
向师性H5MA.558.294−.073
H9MA.330.267.119−.010−.041
H13MA.240.214.147.066.000−.028−.019
H23MA.148.138.122.097.068.039.013−.005−.015−.016−.011−.004
S=Spencer’s weighted moving average
H=Henderson’s weighted moving average
Weighted moving averages are equivalent to kernel regression when the weights are obtained from a kernel function.For example,we may choo weights using the quartic function
Q(j,k)=
1−[j/(k+1)]2
2
for−k≤j≤k; 0otherwi.
Then a j is t to Q(j,k)and scaled so the weights sum to one.That is,
a j=
Q(j,k)
k
言情小说肉
i=−k
Q(i,k)
.
5Forecasting using one-sided moving averages
A simple forecasting method is to simply average the last few obrved values of a time ries. Thus
ˆy t+h|t=
1
k+1
k
j=0梦到自己飞
y t−j
provides a forecast of y t+h given the data up to time t.
As with smoothing,the more obrvations included in the moving average,the greater the smoothing
effect.A forecaster must choo the number of periods(k+1)in a moving average. When k=0,the forecast is simply equal to the value of the last obrvation.This is sometimes known as a“na¨ıve”forecast.
An extremely common variation on the one-sided moving average is the exponentially weighted moving average.This is a weighted average where the weights decrea exponentially.
It can be written as
ˆy t+h|t=t−1
j=0
a j y t−j,
where a j=λ(1−λ)j.Then,for large t,the weights will approximately sum to one.An exponen-tially weighted moving average is the basis of simple exponential smoothing.It is also ud in some process control methods.
6Moving average process
A related idea is the moving average process,which is a time ries model that can be written as
y t=e t−θ1e t−1−θ2e t−2−···−θq e t−q,
where{e t}is a white noi ries.Thus,the obrved ries{y t},is a weighted moving average of the unobrved{e t}ries.This is a special ca of an Autoregressive Moving Average(or ARMA)model and is discusd in more detail on page??.An important difference between this moving average and tho considered previously is that here the moving average ries is directly obrved,and the coefficientsθ1,...,θq must be estimated from the data. References
Kendall,M.G.,Stuart,A.&Ord,J.K.(1983),Kendall’s advanced theory of statistics.Vol.3,Hodder Arnold,London.
Ladiray,D.&Quenneville,B.(2001),Seasonal adjustment with the X-11method,Vol.158of Lecture notes in statistics,Springer-Verlag.
Makridakis,S.,Wheelwright,S.C.&Hyndman,R.J.(1998),Forecasting:methods and applications, 3rd edn,John Wiley&Sons,New York.
Spencer,J.(1904),‘On the graduation of the rates of sickness and mortality’,Journal of the Institute of
Actuaries38,334–343.

本文发布于:2023-06-09 13:50:44,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/911689.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:贵族   锻炼   英国   女孩   时间   名字
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图