Home » date » 2008 » May » 23 »

Opdracht 10 - Oefening 2 - Katrien De Soomer

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Fri, 23 May 2008 09:03:26 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/May/23/t1211555070baie2hjit7tdlku.htm/, Retrieved Fri, 23 May 2008 17:04:30 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
464 675 703 887 1139 1077 1318 1260 1120 963 996 960 530 883 894 1045 1199 1287 1565 1577 1076 918 1008 1063 544 635 804 980 1018 1064 1404 1286 1104 999 996 1015 615 722 832 977 1270 1437 1520 1708 1151 934 1159 1209 699 830 996 1124 1458 1270 1753 2258 1208 1241 1265 1828 809 997 1164 1205 1538 1513 1378 2083 1357 1536 1526 1376 779 1005 1193 1522 1539 1546 2116 2326 1596 1356 1553 1613 814 1150 1225 1691 1759 1754 2100 2062 2012 1897 1964 2186 966 1549 1538 1612 2078 2137 2907 2249 1883 1739 1828 1868 1138 1430 1809 1763 2200 2067 2503 2141 2103 1972 2181 2344 970 1199 1718 1683 2025 2051 2439 2353 2230 1852 2147 2286 1007 1665 1642 1518 1831 2207 2822 2393 2306 1785 2047 2171 1212 1335 2011 1860 1954 2152 2835 2224 2182 1992 2389 2724 891 1247 2017 2257 2255 2255 3057 3330 1896 2096 2374 2535 1041 1728 2201 2455 2204 2660 3670 2665 2639 2226 2586 2684 1185 1749 2459 2618 2585 3310 3923
 
Text written by user:
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time6 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.138188790941126
beta0.0173529526220280
gamma0.352954520634182


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13530515.41444062289714.5855593771033
14883842.90091669694140.0990833030589
15894849.83169597267844.1683040273223
1610451003.8819591418341.1180408581650
1711991159.8620904223439.1379095776585
1812871245.4057987452541.5942012547489
1915651514.8890018472250.1109981527823
2015771547.7779673909429.2220326090567
2110761073.175768685112.82423131488827
22918921.817194474754-3.81719447475382
2310081021.83640049345-13.8364004934452
2410631093.45753715863-30.4575371586332
25544538.4983176462415.50168235375861
26635883.992724365653-248.992724365653
27804851.857147113964-47.8571471139639
28980987.59009966451-7.59009966451094
2910181130.24715952532-112.247159525323
3010641190.1075296698-126.107529669800
3114041417.85280514777-13.8528051477679
3212861431.92714643595-145.92714643595
331104969.842429086618134.157570913382
34999845.741333206727153.258666793273
35996957.87196717625438.1280328237459
3610151027.20670939209-12.2067093920882
37615512.53138942575102.46861057425
38722783.740616251253-61.7406162512533
39832838.814780352263-6.81478035226257
40977994.104798817453-17.1047988174529
4112701104.29767508664165.702324913364
4214371201.89594875293235.104051247072
4315201540.82757247366-20.8275724736561
4417081513.34948377193194.650516228073
4511511140.0385393492510.9614606507496
46934990.346571583594-56.3465715835944
4711591043.96730162844115.032698371563
4812091114.4460185568194.5539814431922
49699600.00137200935498.9986279906462
50830842.553030410869-12.5530304108687
51996931.64538905808564.3546109419151
5211241114.861986004489.13801399552221
5314581307.69773088421150.302269115788
5412701436.98934543368-166.989345433682
5517531663.1807865427389.8192134572671
5622581721.34750618056536.652493819438
5712081285.52525758474-77.5252575847376
5812411085.02930910613155.970690893874
5912651238.3896460571226.6103539428761
6018281298.64872216196529.35127783804
61809748.42591746902560.5740825309753
62997987.915629816219.08437018378993
6311641126.2334165980337.7665834019715
6412051319.64954701957-114.649547019575
6515381578.99607270820-40.996072708195
6615131588.41846016296-75.4184601629597
6713781959.87732467204-581.877324672038
6820832074.328004242288.6719957577152
6913571337.2690226107919.7309773892086
7015361212.28145653055323.718543469453
7115261358.52293692570167.477063074303
7213761605.00054003904-229.000540039041
73779786.704150391548-7.70415039154796
7410051003.535881793461.46411820654123
7511931150.6741581131142.3258418868861
7615221299.02917640314222.970823596856
7715391641.75527564294-102.755275642938
7815461632.17732282556-86.1773228255631
7921161849.7002749325266.299725067501
8023262303.4321197333922.5678802666107
8115961492.1581417881103.841858211899
8213561464.53209893504-108.532098935041
8315531506.7714958091346.228504190874
8416131620.35062075642-7.3506207564185
85814844.989947423514-30.9899474235139
8611501077.9099565550472.090043444965
8712251261.00424991122-36.0042499112217
8816911466.87921964820224.120780351797
8917591726.1090511527532.8909488472527
9017541741.6587426445412.3412573554633
9121002110.94886589595-10.9488658959508
9220622477.55816342208-415.55816342208
9320121593.56220187514418.437798124862
9418971536.99236609413360.007633905866
9519641704.92823507691259.071764923093
9621861846.2276936445339.772306355501
97966979.48087993079-13.4808799307898
9815491295.00860664629253.991393353711
9915381500.5166950419137.4833049580895
10016121857.75200730189-245.752007301893
10120782024.1390438359353.8609561640656
10221372039.4347038086797.5652961913308
10329072479.46702292777427.532977072227
10422492834.49200953365-585.492009533651
10518832063.45276691845-180.452766918448
10617391884.57385781799-145.573857817994
10718281959.24821911067-131.248219110666
10818682076.73532015479-208.735320154794
1091138999.77958578803138.22041421197
11014301433.49724354292-3.49724354292471
11118091538.29530880992270.704691190080
11217631849.57217747235-86.5721774723452
11322002143.1170709924656.8829290075419
11420672172.30985888696-105.309858886960
11525032699.27317331618-196.273173316180
11621412652.32820928588-511.328209285884
11721032010.9299437257892.0700562742206
11819721875.7427232738196.2572767261868
11921811990.75869314381190.241306856194
12023442134.76078172848209.239218271524
1219701135.37809966138-165.378099661379
12211991501.71162455123-302.711624551229
12317181649.208556858968.7914431410995
12416831822.23219311813-139.232193118133
12520252148.50714589241-123.507145892408
12620512101.45775991581-50.4577599158069
12724392597.53863841864-158.538638418635
12823532454.95815170453-101.958151704525
12922302049.68111829082180.318881709178
13018521924.91609796578-72.9160979657772
13121472042.54671457936104.453285420636
13222862176.70038756706109.299612432936
13310071065.76441805878-58.7644180587797
13416651399.86768449305265.132315506950
13516421753.86990491781-111.869904917812
13615181841.29283465705-323.292834657047
13718312152.87654567507-321.876545675072
13822072099.26981765408107.730182345915
13928222590.67641554791231.323584452090
14023932514.71789350983-121.717893509827
14123062180.37736497262125.622635027382
14217851963.20155076723-178.201550767232
14320472123.72126457589-76.7212645758927
14421712234.38742977834-63.3874297783386
14512121047.34686346252164.653136537481
14613351521.24424765127-186.244247651267
14720111693.60188388355317.39811611645
14818601773.6975944832086.3024055167957
14919542158.71790165912-204.717901659125
15021522259.47994712112-107.479947121125
15128352781.2986858768153.7013141231869
15222242565.19655021878-341.196550218777
15321822269.16895953021-87.1689595302146
15419921925.4570188933166.5429811066938
15523892155.82426469756233.175735302438
15627242319.33331671591404.666683284094
1578911180.84303141773-289.843031417725
15812471490.02323328043-243.023233280426
15920171808.76868858983208.231311410165
16022571802.22079463206454.779205367938
16122552156.7921550473998.2078449526139
16222552336.8751785537-81.8751785537015
16330572941.71486638894115.285133611055
16433302593.72160894797736.278391052027
16518962506.1698416447-610.169841644698
16620962113.62988175086-17.6298817508573
16723742404.83255512033-30.8325551203279
16825352593.07494193432-58.0749419343183
16910411127.23701253264-86.237012532636
17017281498.94107698729229.058923012706
17122012073.26056298899127.739437011011
17224552130.9507934861324.049206513899
17322042375.75501482807-171.755014828069
17426602472.00954440677187.990455593228
17536703233.47028240361436.529717596392
17626653093.8830706459-428.883070645898
17726392405.05907050405233.940929495951
17822262299.06592121852-73.0659212185169
17925862604.97460965133-18.9746096513300
18026842804.10579678828-120.105796788276
18111851195.61768993792-10.6176899379157
18217491719.3298081740929.6701918259105
18324592274.99162656601184.008373433991
18426182406.76323322972211.236766770282
18525852488.5995388436296.4004611563769
18633102751.98684954933558.013150450666
18739233726.79165528676196.208344713244


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
1883245.240346468903066.815391864053423.66530107374
1892768.004386666392583.193896508662952.81487682413
1902513.582914997922322.725825586532704.44000440931
1912883.958638013432678.458258161883089.45901786499
1923075.494776202872857.361600673873293.62795173188
1931333.954544451201145.615010901221522.29407800119
1941937.257265440191721.805140373922152.70939050645
1952607.537141051962353.185233664742861.88904843918
1962734.890891558222465.846682548513003.93510056792
1972755.008331558142477.118996861463032.89766625481
1983175.783553093472863.002135688013488.56497049893
1994008.987632258393672.269799298074345.70546521871
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/1eej21211554995.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/1eej21211554995.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/2j8l31211554995.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/2j8l31211554995.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/3a5q41211554995.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/23/t1211555070baie2hjit7tdlku/3a5q41211554995.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
if (par2 == 'Single') K <- 1
if (par2 == 'Double') K <- 2
if (par2 == 'Triple') K <- par1
nx <- length(x)
nxmK <- nx - K
x <- ts(x, frequency = par1)
if (par2 == 'Single') fit <- HoltWinters(x, gamma=0, beta=0)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=0)
if (par2 == 'Triple') fit <- HoltWinters(x, seasonal=par3)
fit
myresid <- x - fit$fitted[,'xhat']
bitmap(file='test1.png')
op <- par(mfrow=c(2,1))
plot(fit,ylab='Observed (black) / Fitted (red)',main='Interpolation Fit of Exponential Smoothing')
plot(myresid,ylab='Residuals',main='Interpolation Prediction Errors')
par(op)
dev.off()
bitmap(file='test2.png')
p <- predict(fit, par1, prediction.interval=TRUE)
np <- length(p[,1])
plot(fit,p,ylab='Observed (black) / Fitted (red)',main='Extrapolation Fit of Exponential Smoothing')
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(myresid),lag.max = nx/2,main='Residual ACF')
spectrum(myresid,main='Residals Periodogram')
cpgram(myresid,main='Residal Cumulative Periodogram')
qqnorm(myresid,main='Residual Normal QQ Plot')
qqline(myresid)
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Estimated Parameters of Exponential Smoothing',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'Value',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'alpha',header=TRUE)
a<-table.element(a,fit$alpha)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'beta',header=TRUE)
a<-table.element(a,fit$beta)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'gamma',header=TRUE)
a<-table.element(a,fit$gamma)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Interpolation Forecasts of Exponential Smoothing',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observed',header=TRUE)
a<-table.element(a,'Fitted',header=TRUE)
a<-table.element(a,'Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nxmK) {
a<-table.row.start(a)
a<-table.element(a,i+K,header=TRUE)
a<-table.element(a,x[i+K])
a<-table.element(a,fit$fitted[i,'xhat'])
a<-table.element(a,myresid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Extrapolation Forecasts of Exponential Smoothing',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Forecast',header=TRUE)
a<-table.element(a,'95% Lower Bound',header=TRUE)
a<-table.element(a,'95% Upper Bound',header=TRUE)
a<-table.row.end(a)
for (i in 1:np) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,p[i,'fit'])
a<-table.element(a,p[i,'lwr'])
a<-table.element(a,p[i,'upr'])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by