Home » date » 2011 » Jan » 15 »

Oefening 10 2

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Sat, 15 Jan 2011 09:22:02 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7.htm/, Retrieved Sat, 15 Jan 2011 10:23:02 +0100
 
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/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7.htm/},
    year = {2011},
}
@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 = {2011},
    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:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
78.1 66.7 79 65.2 66.5 77.2 80.2 77.9 78 86.8 92.9 185.8 91 79.1 84.2 70.1 71.3 79.6 92.3 78.7 82.5 98.2 115.4 205.6 94 83.2 80.3 70.4 71.1 78.8 86.3 77.5 80.1 89.8 99.9 218 85.4 77.5 78.6 68.8 64.8 79.8 94.3 79.9 87.5 99.1 109.9 273.6 91.3 80.6 80.4 71.8 75.5 86.6 91.5 86.8 84.6 88.6 102.1 260.3 79 70.6 79.3 66.8 61.2 72.5 83.5 75.8 83.4 89.4 104.9 251.6 80 76.3 81.1 63.1 63.5 78.8 91.7 83.8 83.8 95.8 108.9 258.2 88.7 79.5 74.3 70.5 59.1 73.2 81.2 75 74.6 89.5 107 246.4 83.6 72.1 68.7 60.1 61.1 72.7 85.3 71.4 75.2 89.8 100.9 222.7
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.202668867194516
beta0.0361437398259691
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
139188.09073183760692.90926816239312
1479.176.87329553841152.22670446158848
1584.282.8505025734381.34949742656197
1670.169.01814573884671.08185426115332
1771.369.68947077763471.61052922236534
1879.677.22973923798972.37026076201026
1992.387.11634428860525.18365571139479
2078.785.5444416107519-6.84444161075187
2182.584.205514429794-1.70551442979406
2298.292.9080945464645.29190545353599
23115.4100.38426481385615.0157351861442
24205.6196.845312730278.75468726972954
2594106.417054500701-12.4170545007014
2683.291.7097731065047-8.50977310650472
2780.394.8935116008563-14.5935116008563
2870.477.5817227413766-7.18172274137662
2971.176.9043943348688-5.80439433486879
3078.883.3979177075786-4.59791770757859
3186.393.914725388047-7.61472538804696
3277.579.864090092618-2.36409009261804
3380.183.2689140735638-3.16891407356385
3489.896.9817464180764-7.18174641807644
3599.9109.319212890896-9.4192128908961
36218195.29314291123922.7068570887611
3785.490.371082648054-4.97108264805395
3877.579.90222471164-2.40222471163999
3978.679.131717771645-0.531717771645091
4068.870.3411711063421-1.54117110634215
4164.871.7082163191013-6.90821631910134
4279.878.73492757833171.06507242166825
4394.387.8304718261066.46952817389402
4479.980.7603608180068-0.860360818006839
4587.583.77883740969963.72116259030041
4699.195.68959361012023.41040638987981
47109.9108.4684237510751.431576248925
48273.6222.41473673667251.1852632633285
4991.3101.562640129634-10.2626401296337
5080.692.3975772484612-11.7975772484612
5180.491.4735139396573-11.0735139396573
5271.879.9235596060426-8.12355960604263
5375.575.8109847655769-0.310984765576919
5486.690.7141643328644-4.11416433286442
5591.5103.213303879361-11.7133038793611
5686.886.62468164311350.175318356886478
5784.693.5245674170871-8.92456741708712
5888.6102.550537618654-13.9505376186541
59102.1110.031774821288-7.93177482128804
60260.3261.48071595557-1.18071595557046
617980.3678716777832-1.3678716777832
6270.671.1933367828603-0.59333678286032
6379.372.61110433046126.68889566953878
6466.866.63700317159010.162996828409902
6561.270.1176405671158-8.91764056711581
6672.579.8656559948387-7.36565599483866
6783.585.2445015194096-1.74450151940964
6875.879.8261500314943-4.02615003149432
6983.478.25886632406695.1411336759331
7089.485.871147533833.52885246617002
71104.9101.5648939163013.33510608369942
72251.6260.633676763997-9.03367676399748
738077.6760984482082.32390155179208
7476.369.7904165711536.50958342884701
7581.178.42919068467652.67080931532351
7663.166.38312799317-3.28312799316996
7763.561.8455064755751.65449352442499
7878.874.97149127331683.82850872668324
7991.787.18084787589344.51915212410664
8083.881.33847809610032.46152190389965
8183.888.5686912908092-4.76869129080919
8295.892.98773301721432.81226698278569
83108.9108.4772161893090.42278381069066
84258.2257.1678593474661.03214065253366
8588.785.45390686966073.24609313033926
8679.581.2471014758121-1.74710147581214
8774.385.2458490309654-10.9458490309654
8870.565.68722967629754.81277032370252
8959.166.7809938570242-7.6809938570242
9073.279.7336713928898-6.53367139288984
9181.290.3029984040844-9.10299840408436
927579.8688352820427-4.86883528204272
9374.679.6044479095331-5.00444790953311
9489.589.7744248869431-0.274424886943137
95107102.4646934511734.53530654882677
96246.4252.236372272151-5.83637227215129
9783.680.60702214977522.9929778502248
9872.172.077217386490.0227826135099605
9968.768.8227110399023-0.122711039902256
10060.163.8242178936079-3.72421789360791
10161.152.96537322823698.13462677176308
10272.769.89327338846422.80672661153582
10385.380.23051703790475.06948296209534
10471.476.0720343238506-4.67203432385058
10575.275.7681754027945-0.568175402794523
10689.890.6699091439106-0.869909143910562
107100.9107.131345980209-6.23134598020853
108222.7246.429334884454-23.7293348844543


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
10978.060522088837161.32189091570394.7991532619712
11066.380948623810449.277232861016883.4846643866041
11162.830695305258145.344431377337180.3169592331792
11254.811254185175236.925258497917672.6972498724329
11354.015675131686635.713068541792272.3182817215811
11464.840307712259846.104534621100483.5760808034192
11576.185790162421557.000632719011195.370947605832
11662.968439854303443.318027777542882.618851931064
11766.653588743847146.522405279268486.7847722084257
11881.204051673497860.5769361890322101.831167157963
11993.347483201157872.2096309037197114.485335498596
120219.782858241138198.119817464553241.445899017723
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/106mm1295083321.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/106mm1295083321.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/27r2d1295083321.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/27r2d1295083321.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/3be2h1295083321.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/15/t1295083378hwj8dbnl2n3p2z7/3be2h1295083321.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; 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=F, beta=F)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=F)
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