Home » date » 2009 » Jul » 04 »

Opgave 10, oefening 1, stap 1, Sara Vandenberghe

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Sat, 04 Jul 2009 10:12:31 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk.htm/, Retrieved Sat, 04 Jul 2009 18:13:32 +0200
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk.htm/},
    year = {2009},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2009},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
9.26 9.29 9.28 9.31 9.27 9.27 9.28 9.25 9.32 9.33 9.31 9.3 9.29 9.33 9.35 9.35 9.37 9.37 9.35 9.33 9.34 9.37 9.33 9.31 9.26 9.27 9.29 9.27 9.29 9.31 9.33 9.35 9.34 9.35 9.38 9.43 9.47 9.5 9.55 9.58 9.61 9.57 9.61 9.65 9.62 9.63 9.62 9.63 9.65 9.72 9.75 9.77 9.78 9.82 9.84 9.9 9.94 9.96 10.03 10.03 10.12 10.12 10.05 10.14 10.17 10.2 10.2 10.35 10.43 10.52 10.57 10.57 10.57 10.65 10.57 10.61 10.63 10.71 10.72 10.77 10.79 10.82 10.9 10.83 10.92 10.91 10.88 10.87 11 10.99 11.03 11.04 10.99 10.9 11 10.99 10.92 10.98 11.15 11.19 11.33 11.38 11.4 11.45 11.56 11.61 11.82 11.77 11.85 11.82 11.92 11.86 11.87 11.94 11.86 11.92 11.83 11.91 11.93 11.99 11.96 12.12 11.85 12.01 12.1 12.21 12.31 12.31 12.39 12.35 12.41 12.51
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.796863822577094
beta0.0468032585328228
gamma0


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
39.289.32-0.0399999999999991
49.319.31663361415677-0.00663361415677244
59.279.33960828797938-0.0696082879793831
69.279.3098046240713-0.0398046240712997
79.289.30226587547783-0.022265875477828
89.259.3078726969698-0.0578726969697936
99.329.2829473206860.0370526793140051
109.339.3350464527953-0.00504645279530003
119.319.35341009795203-0.0434100979520338
129.39.3395841268297-0.0395841268296913
139.299.32733061107319-0.0373306110731892
149.339.315480564614780.0145194353852176
159.359.345489458677520.00451054132247819
169.359.36769085151072-0.0176908515107250
179.379.37154096270876-0.00154096270875748
189.379.3882028645585-0.0182028645585071
199.359.39090860878503-0.0409086087850277
209.339.37399524661972-0.0439952466197244
219.349.35298141547763-0.0129814154776309
229.379.35619723179170.0138027682082935
239.339.38127118070931-0.0512711807093105
249.319.3525778530357-0.0425778530356951
259.269.32922394759101-0.0692239475910146
269.279.28205496925066-0.0120549692506593
279.299.279992281517910.0100077184820861
289.279.29588379757039-0.0258837975703887
299.299.282209305397410.00779069460258519
309.319.29565935815160.0143406418483938
319.339.314863672953080.0151363270469229
329.359.335266562285450.0147334377145487
339.349.35589789937695-0.0158978993769541
349.359.35152730685384-0.00152730685383595
359.389.358551157454530.0214488425454693
369.439.38468382253960.0453161774604087
379.479.431525607516110.0384743924838880
389.59.474350355714480.0256496442855205
399.559.50791215064610.0420878493538925
409.589.556142657505970.0238573424940292
419.619.590735712216890.0192642877831144
429.579.62238720527064-0.0523872052706356
439.619.59498839171460.0150116082853984
449.659.62185712465910.0281428753408957
459.629.66023930097633-0.0402393009763298
469.639.64262943701015-0.0126294370101476
479.629.64654984953122-0.0265498495312162
489.639.63838739041673-0.00838739041673264
499.659.644385123266980.00561487673301997
509.729.661750167694550.0582498323054477
519.759.723230579485520.0267694205144799
529.779.760623777583230.0093762224167655
539.789.78450665929435-0.0045066592943499
549.829.797158695247130.0228413047528733
559.849.832455219640930.00754478035907091
569.99.855843885930790.0441561140692137
579.949.910053638187480.0299463618125184
589.969.954057027167770.00594297283223533
5910.039.979154631916250.0508453680837455
6010.0310.0419296508618-0.0119296508617524
6110.1210.0542366020950.065763397905009
6210.1210.1309070332374-0.0109070332374390
6310.0510.1460747847545-0.09607478475451
6410.1410.08979224802210.0502077519779505
6510.1710.15194951214280.0180504878572290
6610.210.18915502366190.0108449763380918
6710.210.2210231960517-0.0210231960516882
6810.3510.22671269736300.123287302637022
6910.4310.35199611577670.0780038842232642
7010.5210.44410403539250.0758959646074704
7110.5710.53736283262620.0326371673737729
7210.5710.5973674893702-0.0273674893702189
7310.5710.6085359129155-0.0385359129154814
7410.6510.60936739517570.0406326048243368
7510.5710.6748008315678-0.104800831567776
7610.6110.6204349905888-0.0104349905887720
7710.6310.6408766928057-0.0108766928057378
7810.7110.66056076329050.0494392367095315
7910.7210.7301522929775-0.0101522929774944
8010.7710.75187885039790.0181211496021429
8110.7910.7968113345469-0.00681133454688698
8210.8210.8216219897395-0.00162198973949046
8310.910.85050735262890.0494926473710606
8410.8310.9219699896770-0.0919699896770165
8510.9210.87727607251250.0427239274874882
8610.9110.9415082891165-0.0315082891165481
8710.8810.9454124102493-0.0654124102493316
8810.8710.9198599541075-0.0498599541075304
891110.90484111956910.0951588804309438
9010.9911.0089315766759-0.0189315766759321
9111.0311.02140140727070.00859859272929064
9211.0411.0561297254907-0.0161297254907353
9310.9911.0705513701330-0.0805513701329836
9410.911.0306335070855-0.130633507085461
951110.94593491671930.0540650832807472
9610.9911.0104323529006-0.0204323529006025
9710.9211.0148034358867-0.0948034358867478
9810.9810.9563751211830.0236248788170048
9911.1510.99319915534610.156800844653912
10011.1911.14199431534880.0480056846512067
10111.3311.20588495981580.124115040184229
10211.3811.33505336889950.0449466311004816
10311.411.4028116585140-0.0028116585140463
10411.4511.43240823178690.0175917682130962
10511.5611.47891965715760.0810803428423856
10611.6111.57904678895360.0309532110463522
10711.8211.64038384838790.179616151612080
10811.7711.8268839592059-0.056883959205857
10911.8511.82280415357480.0271958464252169
11011.8211.8867387947487-0.0667387947487281
11111.9211.87333124037460.0466687596253887
11211.8611.9520346131103-0.0920346131102896
11311.8711.9167777793567-0.0467777793567006
11411.9411.91583986334300.0241601366570414
11511.8611.9723308784422-0.112330878442163
11611.9211.91586766888560.00413233111438949
11711.8311.9523638963778-0.122363896377792
11811.9111.88349619420650.0265038057935403
11911.9311.9342442595087-0.00424425950869356
12011.9911.96033201080380.0296679891962022
12111.9612.0145496983228-0.0545496983228375
12212.1211.99962288151600.120377118483965
12311.8512.1285784803860-0.278578480385983
12412.0111.92923098186550.0807690181344665
12512.112.01924685169450.0807531483054973
12612.2112.11226183059750.0977381694025485
12712.3112.22245678385390.0875432161460559
12812.3112.3277927440258-0.0177927440257886
12912.3912.34852669327940.0414733067205599
13012.3512.4180343954074-0.068034395407432
13112.4112.39774197261280.0122580273872064
13212.5112.44188884999620.0681111500037979


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
13312.533083321599912.416026164920512.6501404782793
13412.570002481851412.417566271376112.7224386923268
13512.60692164210312.423501745002612.7903415392034
13612.643840802354512.431806186031212.8558754186779
13712.680759962606112.441547970243312.9199719549688
13812.717679122857612.452213354086012.9831448916292
13912.754598283109212.463486810916413.0457097553019
14012.791517443360712.475160143345013.1078747433765
14112.828436603612312.487088760631913.1697844465926
14212.865355763863812.499168332936213.2315431947915
14312.902274924115412.511321327528413.2932285207023
14412.939194084366912.523488768455813.3548994002781
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/1jm3r1246723946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/1jm3r1246723946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/24dqs1246723946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/24dqs1246723946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/34fvv1246723946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jul/04/t1246724012akhcjz19dg5jdtk/34fvv1246723946.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Single ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Double ; par3 = additive ;
 
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