Anda di halaman 1dari 7

NumXLTips&HintsCalendarEffect 1 SpiderFinancialCorp,2012

CalendarEffects
ThisisthefourthissueinourARMAUnpluggedmodelingseries.Inthisissue,westartbyexaminingthe
natureofinputtimeseriesandqualifythemasFlow/Stocktypeofseries.Thisbreakdownholdsa
barrierontheirexposuretoorinfluencebycalendarbasedevents.
Ineconometrictheory,atimeseriessampleisonethathasequallyspacedobservationsacrosstime.
Butareallperiodstreatedequallyintheseseries?Whataboutwhenthesampleperiodisatradingday,
calendarmonthorquarter?Aswewillsee,itdepends..
Whydowecare?
Letstrytoanswerthisquestionwithtwoexamples:
Example1:Considerthemonthlyproductionlevelofagivenfactory.Assumingthefactoryisonly
operationalonweekdays,andproductioncapacity(machineandlabor)isheldconstant,thenamonth
withmoreweekdaysisexpectedtohavehighervalues.
Example2:Considerthemonthlyassetsreturns.Letsassumethatnomajorevents,marketsentiment
changesormajornewsaffectingtheassetsreturnseverdevelopthroughoutanyholdingperiodinour
sampledatahorizon.Ifthatisthecase,onemayarguethattheexpectedreturnsofthemonthswith
moretradingdayswillbehigherandmorevolatilethanreturnsformonthswithfewertradingdays.
Inshort,calendareventsinfluencethevaluesofthetimeseriessample,andaprioradjustmentfor
thoseeventswillhelpustobetterunderstandtheprocess,modelingandforecast.
Bynow,yourinterestshouldbepiquedenoughtointroducethecentralquestionswearetryingto
answerhere:Whatarethecalendarevents?Howdowetestfortheirinfluenceonagiventimeseries?
Howdowequantifyand/oradjustfortheiraffectpriorandposttheanalysisphase?
Howdoweexploitthisnewcalendarinformationtoouradvantage?
Bytheendofthispaper,wearehopingtoleaveyouwithasolidunderstandingofcalendareventsand
thetypeofadjustmentsfortheobservationvaluesyoucandobeforeyourmarchtowardsaserious
analysisexercise.
Background
Ineconometricliterature,timeseriesarebrokenintotwoseparategroups:stockandflow.Thestock
timeseriesdatameasureoneattributeatatime(e.g.unemployment,inflation,etc.),whiletheflow
timeseriesisameasureofanactivity(e.g.productionlevel,assetsreturn,etc.).

NumXLTips&HintsCalendarEffect 2 SpiderFinancialCorp,2012

Whydoweneedtomakethisdistinction?Stocktimeseriesarenotaffectedbycalendarevents(e.g.
tradingdaysinaperiod,Easter,etc.),butflowtypetimeseriesare.
Forflowtypetimeseries,theobservedvaluedependsontheabsolutelengthoftheperiodintermsof
(1)calendarday,(2)workdaysortheoccurrenceofspecialcalendareventsinthisperiod.Considerthe
followingexamples:
1. Monthlyproductionlevelofafactory:Holdingeverythingelse(e.g.capacity)constant,wewould
expectahigherthroughputinmonthswithmoreworkdays.
2. Monthlyretailsales:holdingeverythingelse(e.g.inventory)constant,weexpectahighersales
levelinthemontharoundtheholiday(s)(e.g.Easter,Christmas,Ramadan,etc.)
Hangon,whataboutleapyears?IsthemonthofFebruarythesameinaleapyearversusnonleapyear?
Foraflowtypeseries,itisnot.
Calendarevent
Acalendareventisadeterministic(predictable)factorandexogenoustothetimeseriesprocess,but
whichmayinfluencetheobservedvaluesineachperiod.
Examples:
1. Numberofworkdaysinaperiod
2. Numberofoccurrencesofagivenweekday(e.g.Monday)inaperiod
3. Occurrenceofamovingholiday(e.g.Easter)inaperiod
4. Occurrenceofaholidayinaperiod
5. Longweekendeffect?
6. Foreventsthatcanspanafewperiods(e.g.Ramadan),thenumberofdays(orweekdays)ofthe
holidayineachperiod.
Framework
Calendarevents(weekdays,holidays,events,etc.)areexpressedasregressionvariableswhichaffectthe
timeseriesconditionalmean.

,
1
,
1
( )
N
t o j j t t
i
N
t t o j j t
i
y x z
z y x
| |
| |
=
=
= + +
=


Where:
- N isthenumberofregressionvariables
- { }
t
z arethecorrelatedresiduals

NumXLTips&HintsCalendarEffect 3 SpiderFinancialCorp,2012

Dissimilartomultiplelinearregression,theregressionresiduals{ }
t
z arecorrelated,soweusean
econometricmodeltocapturecorrelations(e.g.ARMA/ARIMA),andyieldwhitenoiseresiduals.
Thenewmodelcanbeexpressedasfollows:

1 2 1 1 2 1
2
( , ,..., , , ,..., )
~ i.i.d ~ (0, )
t t t t t t
t
z f z z z a a a a
a o

= +
u

ThemodelingaboveissimilartoanARMAXtypeofmodel.
IMPORTANT:
1. Thisformulationisdefinedasprioradjusted,astheregressionvariablesarecapturedfirstand
residualsaretheonesmodeledwithARIMA.
2. ThevaluesoftheregressioncoefficientsandtheARMA/ARIMAmodelsarecalculated
concurrently.TheLLFoptimizerwillincludetheregressioncoefficientsaspartofitsfree
parameterspoolasweseekoptimalmaxima.
3. Toevaluatewhetheraregressionvariableissignificantinthemodel,theAIC(Akaike
informationcriteria)valuesfordifferentcandidatemodelsarecompared(i.e.AICtest).AIC
penalizesthemodelwithmorefreeparameters.
TheUSCensusbureaufittedaseasonalARIMAmodelwitharegressionandcalleditregARIMA;thatis,a
regARIMAwithorder ( , , ) ( , , )
s
p d q P D Q
regARIMAisexpressedasfollows:
,
1
2
( ) ( )(1 ) (1 ) ( ) ( )
( ) ( )(1 ) (1 ) ( ) ( ) ( )
~ i.i.d ~ (0, )
s d s D s
t t
N
s d s D s
t o j j t t
i
t
L L L L z L L a
L L L L y x L L a
a
| u
| | | u
o
=
u = O
u = O
u


TheorderoftheARIMAmodel ( , , ) ( , , )
s
p d q P D Q isidentifiedusingstandardmodelidentification
procedures(e.g.BoxJenkins,etc.)andthevaluesoftheregressionparametersandtheARIMAmodel
areevaluatedduringthesameprocess.
Themodelhastotalnumberofparametersof 2 p P q Q N + + + + +
Now,weneedtodefinetheregressionvariablefordifferentcalendarevents:movingholidays,leap
yearsandthetradingdayseffect.
1. MovingHoliday
Movingholidaysareholidayswhichoccureachyear,butwheretheexacttimingshiftsunderthe
Gregoriancalendarsystem.ExamplesofmovingholidaysincludeEasterSunday,LaborDay,and

NumXLTips&HintsCalendarEffect 4 SpiderFinancialCorp,2012

ThanksgivingDay.Theseholidaysareconsideredmovingholidaysbecausetheireffectsonserieshave
thepotentialtoaffectmorethanonemonth.
Themovingholidayvariableassumesthatthefundamentalstructureofthetimeserieschangesfora
fixednumberofdaysbeforeeachofthesethreeholidays.ForThanksgivingDay,theeffectcontinues
aftertoChristmas(Dec.24
th
).Themovingholidayhasaneffectonretailsales,and/ortourismand/or
travel.
Howdowedefinethevariables?
Example1:EasterHoliday
TheEasterholidayeffectisassumetostartwdaysbeforethemovingholiday,andthusitcanbe
distributedinFebruary,Marchorboth.

1
( , ) {no. of the w-days falls in month t} E w t
w
=
So,ifweassumetheEastereffecthasa10dayeffectbeforetheholiday,thenwecandistributethe
effectonthemonthswheretheperiodoccurs.

AnothermethodoftreatingEasterisoneadoptedbyCanadianStatistics:IfEasterfallsonorbefore
Aprilwth,thentheEastervariableisdefinedasfollows:

/ March
( , ) / April
0 Else
g
g
n w
E w t n w


IfEasterfallsafterAprilw,then ( , ) 0 E w t = forallmonthsthatyear.
Where:
-
g
n isthenumberofwdaysthatfallinMarch.
Althoughwearereferringtothesamemovingholiday,theregressionvariabledefinitionvariesbetween
CanadaandAmericanstatistics.
Example2:Thanksgivingholiday
TheThanksgivingholidayeffectisassumedtostartwdaysbeforethanksgivingandcontinueto
Christmas(i.e.Dec24
th
).If 0 w< ,itisassumedthattheeffectstartsafterThanksgiving.
( , ) {fraction of days from w-days before Thanksgiving Through Dec 24 falls in the month} ThC w t =

NumXLTips&HintsCalendarEffect 5 SpiderFinancialCorp,2012

2. FixedHoliday
Unlikemovingholidays,fixedholidaysoccureitheronafixeddateoronaparticulardayofagiven
monthanddonottypicallyaffectothermonths.Forthisreason,fixedholidayarebelievedtobe
absorbedbytheseasonalcomponentoftheseries,andnospecialtreatmentforthemisneeded.
3. TradingDay(ordayofweekeffect)
Thetradingdayeffectisrelatedtomonthshavingdifferentnumbersofeachdayoftheweekfromyear
toyear.Ineachmonth,therearefourweeksandanadditionalone,twoorthreedays,whichtranslate
thateachweekdayoccurringatleastfourtimes/month,andsomeweekdayswilloccurfivetimes.Why
thisisimportant:recallourexampleonthefactory,oraretailstoreopenduringtheweekdays.
Thetradingdayeffectoccurswhenaseriesisaffectedbythedifferingdayoftheweekcompositionsof
thesamecalendarmonthindifferentyears.
Tradingdayeffectscanbemodeled(monthlyandquarterlyflow)withsevenvariablesthatrepresent
(no.ofMondays)...(no.ofSundays)inmontht.

1,
2,
7,
no. Mondays in a month
no. Tuesdays in a month
...
no. Sundays in a month
t
t
t
D
D
D
=
=
=

Furthermore,BellandHillmer(1983)note,however,thatabetterparameterizationofthesameeffect
insteaduses6contrastvariablesdefinedas(no.ofMondays)(no.ofSundays),...,(no.ofSaturdays)
(no.ofSundays)

1,
2,
6,
(no. of Mondays) - (no. of Sundays)
(no. of Tuesdays) - (no. of Sundays)
...
(no. of Saturdays) - (no. of Sundays)
t
t
t
TD
TD
TD
=
=
=

Inaddition,wecanalsouseamoreparsimoniousmodeltocapturethetradingdayseffect.Thismodel
reducesthenumberoftradingdayregressorsfromsixtoonebyassumingthedailyeffectofweekdays
(MondaythroughFriday)isthesame,andthedailyeffectofweekenddays(SaturdayandSunday)isthe
same.

5 7
, ,
1 6
5
2
t i t j t
i j
TD D D
= =
=

NumXLTips&HintsCalendarEffect 6 SpiderFinancialCorp,2012

Whilethisconstrainedmodelhasfewerregressionvariables(akaregressors),itispotentiallylessprecise
duetoitsfundamentalassumptionthatweekdayshavethesameeffect,andSaturdaysandSundays
havethesameeffect.
4. LeapYeareffect

0.75 Feb in Leap Year (Q1)


0.25 Feb in non-Leap Year (Q2)
0 Else
t
LY

5. Lengthofthemontheffect
Atimeserieswillnotexhibitatradingdayeffectiflevelsofactivityareconstantovereachdayofthe
week.However,differentmonthshavedifferentlengths(28,29,30and31days),hencemonthlyactivity
canvarypurelybecausecertainmonthsarelongerthanothers.Thisisknownasthelengthofmonth
effect.
Thelengthofmontheffectishandledintwoways.(1)FornonFebruarymonthstheeffectis
automaticallyabsorbedintotheseasonalcomponentofthedecompositionoftheseriesbecausethese
monthshaveconstantmonthlengths.ForthemonthofFebruary,thelengthofthemonthishandled
withaleapyearregressionvariable.
Furthermore,(2)Ifaserieshastradingdaycorrections,thentheseadjustmentswillincludethelengthof
themontheffect.Ifthereisnotradingdayeffectinatimeseries,thenthelengthofmontheffectis
accountedforintheseasonalcomponent.
Insum,wecanignorethelengthofmontheffect(monthlydata)orlengthofquarterforquarterlydata.
Conclusion
Wehavecoveredalotofgroundinourdiscussionhere,butthemaintakeawayistounderstandthe
underlyingsampledataanditspotentialsensitivity(influence)tocalendarevents(e.g.tradingday,
movingholiday(s),leapyear,etc.).
Oncewehaveaninitialsetofsuspects,wecandecidehowwequantifytheiroccurrenceoreffectfor
eachperiod.Thedecisionbetweendifferentvariables(forthesameholidayeffect)ismainlydriven
throughexperienceand,tosomeextent,thesoftwaretoolsavailable.Forinstance,inourexampleof
theEasterholiday,IrestrictedthevariablesthataresupportedbyX12ARIMAprogram.

NumXLTips&HintsCalendarEffect 7 SpiderFinancialCorp,2012

TheburningquestionIsuspectisonyourmindnow:canIdesignmyownvariable(s)tomodeltheeffect
ofamovingholiday?Youbet!Afterall,youonlyneedtogeneratethetimeseriesforthisvariablefor
pastdatapoints,andincludeitasanexternalregressionvariableinthemodel.
Inaddition,ifyouareconductingaforecast,thenyoullneedtoprovidethevaluesforthisvariable
coveringtheoutofsampleforecasthorizon.
Bydefiningyourownvariable,youcansupportnonUSorCanadamovingholidays(e.g.ChineseNew
Year,Ramadan,Hanukkah,etc.),oryoucanredefinethe(weight)effectofdayspriororpostthe
holiday.Asyoucansee,thepossibilitiesareendless.
Inournextissue,welldelveintotheseasonaladjustmentprocedureusingnonparametricmethods
(e.g.X11/X12ARIMA)andmodelbased(e.g.SEATS/TRAMOinX13ARIMA)methods.

Anda mungkin juga menyukai