Home » date » 2010 » Nov » 27 »

Workshop 8 Regression Analysis of Time Series

*The author of this computation has been verified*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Sat, 27 Nov 2010 13:02:33 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb.htm/, Retrieved Sat, 27 Nov 2010 14:01:25 +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/2010/Nov/27/t1290862881mc63hzbml9zrxhb.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
24 25 17 18 18 16 20 16 18 17 23 30 23 18 15 12 21 15 20 31 27 34 21 31 19 16 20 21 22 17 24 25 26 25 17 32 33 13 32 25 29 22 18 17 20 15 20 33 29 23 26 18 20 11 28 26 22 17 12 14 17 21 19 18 10 29 31 19 9 20 28 19 30 29 26 23 13 21 19 28 23 18 21 20 23 21 21 15 28 19 26 10 16 22 19 31 31 29 19 22 23 15 20 18 23 25 21 24 25 17 13 28 21 25 9 16 19 17 25 20 29 14 22 15 19 20 15 20 18 33 22 16 17 16 21 26 18 18 17 22 30 30 24 21 21 29 31 20 16 22 20 28 38 22 20 17 28 22 31
 
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'Gwilym Jenkins' @ 72.249.127.135


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.098155242834915
beta0.0343410839300175
gamma0.291862308416832


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
132323.9407051282051-0.940705128205131
141818.4734042273127-0.47340422731267
151514.67537562900660.324624370993439
161210.87343861823431.12656138176569
172119.61234662797671.38765337202334
181514.04822629500890.951773704991053
192021.5695302857669-1.56953028576691
203118.00473123184212.995268768158
212721.95501413134935.04498586865068
223422.100273839195511.8997261608045
232129.7501400020546-8.75014000205462
243136.1352856044103-5.13528560441032
251928.7353310927983-9.73533109279827
261622.5549834855285-6.55498348552847
272018.37676073373011.6232392662699
282114.92444038538496.07555961461514
292224.245592945388-2.24559294538802
301718.2256250315818-1.22562503158176
312424.8777271260046-0.877727126004594
322525.2249952297038-0.224995229703811
332625.75094477994750.249055220052501
342527.1794943734804-2.17949437348036
351727.9143781778676-10.9143781778676
363234.9335903984696-2.93359039846963
373326.44138243111706.55861756888296
381322.6548450980675-9.65484509806753
393220.271892752503511.7281072474965
402518.96430579826406.03569420173602
412926.07213541486732.92786458513271
422220.82671629395751.17328370604254
431827.8122182439617-9.81221824396166
441727.430574310146-10.430574310146
452027.0214157974156-7.02141579741562
461527.0144401806347-12.0144401806347
472024.3690123524528-4.36901235245283
483334.0375962623899-1.03759626238988
492928.14261841147010.857381588529947
502319.42228068985923.57771931014081
512623.90450479883612.0954952011639
521820.0586595880739-2.05865958807387
532025.4322347737117-5.43223477371167
541118.7544917138134-7.75449171381337
552821.79214377139456.20785622860549
562622.6941950387913.30580496120899
572224.4509772793287-2.45097727932865
581723.5140868067799-6.51408680677995
591223.3751842851588-11.3751842851588
601433.163585956078-19.163585956078
611725.8577677766990-8.85776777669897
622116.73665706921084.26334293078918
631920.7351344812155-1.73513448121549
641815.24604563191872.75395436808126
651020.0464388758477-10.0464388758477
662912.131391094419516.8686089055805
673121.17087568698999.8291243130101
681921.5865716512114-2.58657165121142
69921.1519161460759-12.1519161460759
702018.06285726704951.93714273295050
712817.371961888000410.6280381119996
721927.2422284888402-8.24222848884021
733023.73000624094746.26999375905261
742919.60738988685919.3926101131409
752622.60769383976263.39230616023736
762318.89801503815524.10198496184484
771320.5605510453933-7.56055104539328
782120.0813916657840.918608334216017
791925.7560969619197-6.75609696191973
802821.27366188079346.72633811920658
812319.26455804777123.73544195222881
821821.5261016266073-3.52610162660731
832122.6508449980264-1.65084499802639
842026.3718732685513-6.37187326855135
852326.892293994386-3.89229399438598
862122.5890896770853-1.58908967708532
872122.890074592955-1.89007459295501
881518.7888538806877-3.78885388068774
892816.520669792417511.4793302075825
901920.1199466417961-1.11994664179613
912623.54532637082492.45467362917508
921023.5176592493214-13.5176592493214
931618.6679263427215-2.66792634272150
942218.30169066257133.69830933742869
951920.5655827255514-1.56558272555139
963122.98906442946358.01093557053652
973125.55910296538545.4408970346146
982922.79490547403916.20509452596095
991923.8246475836695-4.82464758366946
1002218.96864592880863.03135407119143
1012321.44474661233481.5552533876652
1021520.7761976475165-5.77619764751653
1032024.6923253165335-4.69232531653347
1041819.7417940100302-1.74179401003025
1052318.92622527063174.07377472936827
1062520.94262734257434.05737265742570
1072121.9026599410408-0.902659941040831
1082426.9605532153950-2.96055321539497
1092527.7888928073504-2.78889280735043
1101724.4019871167118-7.40198711671178
1111321.1310096444457-8.13100964444574
1122817.945214558607310.0547854413927
1132120.67277489485180.327225105148205
1142517.90040909917987.0995909008202
115923.3555197336149-14.3555197336149
1161618.1904114571158-2.19041145711583
1171918.81733198158930.182668018410684
1181720.3901497325718-3.39014973257184
1192519.23117817309495.76882182690513
1202024.3422946477942-4.34229464779417
1212925.01558468742873.98441531257131
1221421.0375047068512-7.03750470685117
1232217.56986566603594.43013433396406
1241520.4055699810182-5.40556998101823
1251919.0048598459936-0.00485984599361799
1262017.93104294875192.06895705124815
1271517.1766773394644-2.17667733946443
1282016.38167392627843.61832607372156
1291818.195616076569-0.195616076569014
1303318.781845417454014.2181545825460
1312221.81230818769010.187691812309911
1321623.7457153533617-7.7457153533617
1331726.2966806952366-9.29668069523663
1341618.0891232220929-2.08912322209294
1352118.11758315059942.88241684940057
1362618.19919456952167.80080543047845
1371819.5475436969447-1.54754369694466
1381818.8942020398857-0.894202039885734
1391716.74752532346290.252474676537052
1402217.74052387705034.25947612294967
1413018.639913656683711.3600863433163
1423024.21966081458245.78033918541763
1432422.76579650521211.23420349478794
1442122.7541739536077-1.7541739536077
1452125.5456373902177-4.54563739021775
1462919.77820137382079.22179862617935
1473122.34024341838748.65975658161259
1482024.4177706252788-4.41777062527876
1491622.1992440725596-6.19924407255963
1502221.33866546720800.661334532791972
1512019.72912092631150.270879073688477
1522821.86131503287216.13868496712787
1533824.903165098947713.0968349010523
1542229.2795896433223-7.27958964332232
1552025.3980709242075-5.39807092420746
1561723.9773706994309-6.97737069943092
1572825.53228931651032.46771068348967
1582224.1115721224774-2.11157212247739
1593125.40957800659395.59042199340615


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
16023.729624469392011.097121554813836.3621273839703
16121.47669209550358.7792511462249334.1741330447821
16223.052178122410410.285780061279635.8185761835411
16321.29449000394978.455039292490734.1339407154087
16424.963217802541912.046548018448037.8798875866358
16529.231947983733316.233827466753142.2300685007136
16626.913271339817113.829408880263439.9971337993708
16724.219855306317011.045905850222437.3938047624115
16822.90983484389529.6414051889485636.1782644988419
16927.655745693848514.288400150667441.0230912370295
17024.799202516971311.328468510985738.2699365229570
17128.350590705698514.771964295910541.9292171154866
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/14uzi1290862949.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/14uzi1290862949.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/2x3y31290862949.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/2x3y31290862949.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/3x3y31290862949.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290862881mc63hzbml9zrxhb/3x3y31290862949.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