forecaforecasting by smoothing methodssting by smoothing methods

Download ForecaForecasting by smoothing methodssting by Smoothing Methods

Post on 06-Feb-2016

220 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Forecasting by smoothing methods

TRANSCRIPT

  • Economics 20 - Prof. Anderson 1

    D bo s dng m hnh chui thigian(Time Series Models for Forecasting)

    D bo bng phng php lm trn s liu

    Nguyn Ngc AnhTrung tm Nghin cu Chnh sch v Pht trin

    Nguyn Vit Cngi hc Kinh t Quc dn

  • Economics 20 - Prof. Anderson 2

    Ni dung

    Mt s khi nim v mt vi m hnh gin nLm trn bng phng php trung bnh Trung bnh trt gin n (simple moving averages - SMA) Phng php trung bnh trt kp (Double moving average) ng dng ca phng php trung bnh trt trn th trng chng

    khon Trung bnh trt c trng s

    Lm trn s liu theo qui lut s m Lm trn theo qui lut s m gin n (Simple Exponential

    Smoothing)

  • Economics 20 - Prof. Anderson 3

    Trong chng ny chng ta s xem xt ccphng php lm trn s liu (smoothing). Mc d cc phng php ny l nhngphng php gin n, v pht trintng i sm, nhng gi tr s dng thctin ca cc phng php ny vn cn.

  • Economics 20 - Prof. Anderson 4

    Mt s khi nim v mt vi m hnh gin n

    M hnh gin n (Naive model):

    M hnh ny d bo rng gi tr ca ngy hm sau, hoc mt ngy t+i trong tng lai s bng gi tr cangy hm nay.

    M hnh ny rt c ch v s d bo tng i tt khidy s liu l qu ngn v khng c mt xu hng cth no (no systematic pattern), hoc xu hng ny thayi rt chm.

    tit YF =+

  • Economics 20 - Prof. Anderson 5

    Naive Forecasting

    Simplest of thenaive forecasting

    models

    Simplest of thenaive forecasting

    models

    t t

    t

    t

    F XF

    Xwhere t

    t

    ===

    1

    1 1

    : the forecast for time period

    the value for time period -

    We sold 532 pairs of shoes lastweek, I predict well

    sell 532 pairs this week.

    We sold 532 pairs of shoes lastweek, I predict well

    sell 532 pairs this week.

  • Economics 20 - Prof. Anderson 6

    Mt s khi nim v mt vi m hnh ginn

    M hnh d bo trung bnh (Mean Forecast model)

    M hnh ny d bo gi tr ca tng lai bng vitrung bnh ca dy s. M hnh d bo trung bnh ny s d bo tt khis liu ca dy s bin ng xung quanh mt hngs hoc mt gi tr n nh (fluctuated around a constant or stationary value).

    YF it =+

  • Economics 20 - Prof. Anderson 7

    Simple Average Model

    tt t t t nF X X X Xn=+ + + + 1 2 3 L

    The monthly average last12 months was 56.45, so I predict

    56.45 for September.

    The monthly average last12 months was 56.45, so I predict

    56.45 for September.

    Month Year

    Cents per

    Gallon Month Year

    Cents per

    GallonJanuary 2 61.3 January 3 58.2February 63.3 February 58.3March 62.1 March 57.7April 59.8 April 56.7May 58.4 May 56.8June 57.6 June 55.5July 55.7 July 53.8August 55.1 August 52.8September 55.7 SeptemberOctober 56.7 OctoberNovember 57.2 NovemberDecember 58.0 December

  • Economics 20 - Prof. Anderson 8

    Mt s khi nim v mt vi m hnh ginn

  • Economics 20 - Prof. Anderson 9

    Mt s khi nim v mt vi m hnh ginn

  • Economics 20 - Prof. Anderson 10

    Trung bnh trt gin n (simple moving averages - SMA)

    tng chnh ca s dng trung bnh trtl tm ra xu hng ca dy s. Gi thit cbn ca trung bnh trt l gi tr ca dy strung tng lai s bng gi tr trung bnhca s liu trong qu kh. Cng thc nhsau

    nYYYYnSMAF tttnttt

    )...()( 123 ++++==

  • Economics 20 - Prof. Anderson 11

    Trung bnh trt

    Cp nht (tnh ton li) vi mi k miC th gp kh khn khi chn s thi k ti uC th khng iu chnh c cho xu hng, vtnh ma v

    tt t t t nF X X X Xn=+ + + + 1 2 3 L

    Tnh li cho mi k.

  • Economics 20 - Prof. Anderson 12

    V d: Trung bnh trt bc 4 ctnh bng cng thc

    4)( 1234 +++== tttttt YYYYSMAF

    4)( 2345

    11

    +++== tttttt YYYYSMAF

    4)( 3456

    22

    +++== tttttt YYYYSMAF

    4)( 4567

    33

    +++== tttttt YYYYSMAF

    4)( 1234

    +++== ktktktktktkt YYYYSMAF

  • Economics 20 - Prof. Anderson 13

    Minh ha:Four-Month Moving Average

    00.67

    00.1294136100.1294

    41259119113811345

    75.15

    25.1243125925.1243

    41191138113451056

    ==

    =

    +++==

    ==

    +++=

    Error

    F

    Error

    F

    June

    June

    May

    MayMonths Shipments

    4-Mo Moving Average

    Forecast Error

    January 1056February 1345March 1381April 1191May 1259 1243.25 15.75June 1361 1294.00 67.00July 1110 1298.00 -188.00August 1334 1230.25 103.75September 1416 1266.00 150.00October 1282 1305.25 -23.25November 1341 1285.50 55.50December 1382 1343.25 38.75

  • Economics 20 - Prof. Anderson 14

    Minh ha:Four-Month Moving Average

    1000

    1100

    1200

    1300

    1400

    1500

    0 2 4 6 8 10 12

    Time

    S

    h

    i

    p

    m

    e

    n

    t

    s

    Shipments 4-Mo Moving Average

  • Economics 20 - Prof. Anderson 15

  • Economics 20 - Prof. Anderson 16

    Phng php trung bnh trt kp (Double moving average):

    Chui s thi gian qua bin i trung bnhtrt kp (trung bnh trt hai ln) c khiu l MA(pxq), l mt trung bnh trtbc p (s dng p thi k/quan st) ca mtchui c bin i trung bnh trt bc q. q l bc (q quan st) ca ln trungbnh trt th nht, v p la trung bnh trt ln th hai.

  • Economics 20 - Prof. Anderson 17

    V d: Gi s ta thc hin php trung bnh trt bc 4 ln thnht vi mt chui thi gian Y ta s c:

    4)( 1234 +++= ttttt YYYYSMA

    4)( 2345

    1

    +++= ttttt YYYYSMA

    4)( 3456

    2

    +++= ttttt YYYYSMA

    4)( 4567

    3

    +++= ttttt YYYYSMA

  • Economics 20 - Prof. Anderson 18

    Ta tip tc thc hin php bin i trung bnh trt bc 3 vichui s ny, ta s c chui trung bnh trt kp (3-perioddouble moving average):

    3)( 123 ++== ttttt SMASMASMADMAF

    nSMASMASMASMADMAF tttnttt

    )...( 123 ++++==

  • Economics 20 - Prof. Anderson 19

    u im: bng phng php ny c th loi bc nhng bin thin ngu nhin qu ln, vphng php ny t b tc ng ca cc quan stngoi bin (outlier), c bit l so v phng phpsai phn bc nhtNhc im: Phng php ny khng x l cvn ma v (seasonality) ca chui thi gian, v vic xc nh s bc ti u (the optimal number of period) cng gp kh khn.

  • Economics 20 - Prof. Anderson 20

    ng dng ca phng php trung bnh trt trn thtrng chng khon

    HSPI

    MA

    Thi gian

    Gi

    Mua

    Bn

  • Economics 20 - Prof. Anderson 21

  • Economics 20 - Prof. Anderson 22

    Trung bnh trt c trng sFt = WMA4 = [0.4Yt-1 + 0.3Yt-2 + 0.2Yt-3 + 0.1Yt-4]u im: Trng s i vi cc quan st trong qu kh cth khc nhau. Tuy nhin vic xc nh c trng s tiu li c th rt kh khn. Loi m hnh ny rt c ch khis liu c c im l nhng thay i theo tng thi k ckich thc gn nh nhau. (This type of model is most useful when the historical data are characterized by period-to-period changes that are approximately the same size.)Hn ch ca m hnh WMA: M hnh ny khng x lc vn xu hng v ma v. Rt kh xc nh cbc thc hin trung bnh trt bi v RSE khng c gitr, ng thi vic xc nh trng s cng rt kh khn, nnphng php ny thng khng c s dng.

  • Economics 20 - Prof. Anderson 23

    Trung bnh trt c trng s

    tt t t t t t t n t n

    ii t

    t nF W X W X W X W XW

    = + + + +

    =

    1 1 2 2 3 3

    1

    L

  • Economics 20 - Prof. Anderson 24

    V d: Trung bnh trt trng s 4 thng

    ( ) ( ) ( ) ( )

    ( ) ( ) ( ) ( )

    May

    May

    June

    June

    F

    Error

    F

    Error

    = + + +

    == == + + +

    == =

    4 1191 2 1381 1 1345 1 10568

    1240 88

    1259 1240 88

    18 134 1259 2 1191 1 1381 1 1345

    81268 00

    1361 1268 0093 00

    .

    .

    .

    .

    ..

    Months Shipments

    4-Mo WeightedMoving Average

    Forecast Error

    January 1056February 1345March 1381April 1191May 1259 1240.88 18.13June 1361 1268.00 93.00July 1110 1316.75 -206.75August 1334 1201.50 132.50September 1416 1272.00 144.00October 1282 1350.38 -68.38November 1341 1300.50 40.50December 1382 1334.75 47.25

  • Economics 20 - Prof. Anderson 25

    Lm trn theo qui lut s m ginn (Simple Exponential Smoothing)

    Trung bnh trt gin n s dng trng s bng nhau chott c cc quan st, nhng trn thc t cc quan st nm u v cui dy s c trng s thp hn cc quan st khc(tc l c s dng t hn trong vic tnh trung bnh)

    Trong phng php trung bnh trt kp th vn trngs li tr nn nghim trng hn. Trung bnh trt kp thmch dnh cho nhng quan st nm gia dy s trng s caohn c nhng quan st gn k d bo hn (nhng quan stgn y hn) bi v cc quan st nm gia dy s cs dng nhiu hn trong vic tnh ton con s trung bnh.

  • Economics 20 - Prof. Anderson 26

    Lm trn theo qui lut s m ginn (Simple Exponential Smoothing)

    Do phng php trung bnh trt c trng s c pht trin s dng. Trung bnh trt ctrng s gii thiu trn, trng s gim dn t Yt-1 n Yt-4 mt cch u n (0.4 0.1).

    Tuy nhin tc ng ca cc quan st trong qu khli c th khng gim u n nh vy, m ligim mt cch phi tuyn hn. x l vn ny, ngi ta pht trin cc phng php trungbnh trt c trng s thay i theo s m

  • Economics 20 - Prof. Anderson 27

    Lm trn theo qui lut s m ginn (Simple Exponential Smoothing)

    Nhn nhn mt gc khc, trong phng phptrung bnh trt gin n trn, gi s c bctrt l k, th ch c k quan st gn nht c sdng, cn tt c cc quan st trc u khngc s dng. y c th c coi l mt nhc im. Do ngi ta tm cch xy dng phng php lm trnsao cho cc d liu trong qu kh vn c sdng v c trng s gim dn thay v b loi bnh phng php trung bnh trt.

  • Economics 20 - Prof. Anderson 28

    Lm trn theo qui lut s m ginn (Simple Exponential Smoothing)

    Ft = Ft-1 + (Yt-1 Ft-1)

    Ft = 1*Yt-1 + (1-1) Ft-1 Ft= Yt-1 (Naive model)

    11 )1( += ttt FYF

  • Economics 20 - Prof. Anderson 29

    Lm trn theo qui lut s m ginn (Simple Exponential Smoothing)

    Cng thc ny cho thy con s d bo l trungtrnh c trng s gia gi tr thc t gn y nht(Yt-1) v gi tr d bo gn y nht (Ft-1). So snh vi m hnh adapti

Recommended

View more >