Home » date » 2008 » May » 26 »

Mathieu Demoor - Opgave 10.2

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Mon, 26 May 2008 08:58:41 -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/26/t12118139862lmupso6qc5svd5.htm/, Retrieved Mon, 26 May 2008 16:59:49 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
113 110 107 103 98 98 137 148 147 139 130 128 127 123 118 114 108 111 151 159 158 148 138 137 136 133 126 120 114 116 153 162 161 149 139 135 130 127 122 117 112 113 149 157 157 147 137 132 125 123 117 114 111 112 144 150 149 134 123 116 117 111 105 102 95 93 124 130 124 115 106 105
 
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'Gwilym Jenkins' @ 72.249.127.135


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.937593174294072
beta0.0731471036939834
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13127122.5545833333334.44541666666665
14123122.6694449772030.330555022796545
15118118.073910629612-0.0739106296119871
16114114.177416424979-0.177416424978730
17108108.296708279908-0.29670827990779
18111111.283803991852-0.283803991852068
19151151.221868100264-0.221868100264260
20159159.161120003202-0.161120003201972
21158158.187945605629-0.187945605628727
22148148.343396645151-0.343396645150591
23138138.412880278382-0.412880278382204
24137137.430566949828-0.430566949828261
25136136.179565822465-0.179565822465264
26133131.5340334853401.46596651465961
27126127.888434317083-1.88843431708335
28120122.070374080312-2.07037408031229
29114114.063752344231-0.0637523442314603
30116116.942403115319-0.94240311531891
31153155.893998058285-2.89399805828549
32162160.7755732841911.22442671580916
33161160.6387308458920.361269154108214
34149150.876013973298-1.87601397329829
35139138.9756727850710.0243272149286042
36135137.90364608892-2.90364608892006
37130133.681425394496-3.68142539449602
38127124.9469589231012.05304107689935
39122120.7744152769961.22558472300449
40117117.210206036495-0.210206036494895
41112110.5459888006181.45401119938174
42113114.370038852264-1.37003885226360
43149152.346752738744-3.34675273874350
44157156.5776552972630.422344702736893
45157155.0967199591521.90328004084841
46147146.2077154126510.792284587348945
47137136.6783000380010.32169996199903
48132135.473309999590-3.47330999958976
49125130.400316274253-5.40031627425279
50123120.026092635862.97390736414009
51117116.3424564093120.657543590687624
52114111.7942434105882.20575658941212
53111107.3029577236673.69704227633292
54112113.011533432335-1.01153343233503
55144151.183321242829-7.18332124282941
56150151.771482489708-1.77148248970838
57149147.8947743968731.10522560312731
58134137.702177581065-3.70217758106509
59123123.135169070005-0.135169070004679
60116120.439405733113-4.43940573311335
61117113.4485104151853.55148958481513
62111111.712143845337-0.712143845337124
63105103.8972329429211.10276705707878
6410299.36291059061582.63708940938416
659594.89852088659020.101479113409752
669396.2248969991282-3.22489699912825
67124131.067314299266-7.06731429926583
68130131.240960305020-1.24096030502017
69124127.216558566435-3.21655856643456
70115111.5508402194423.44915978055781
71106103.2809056927452.71909430725508
72105102.5578414109242.44215858907555


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
73102.55486817711297.7048423823639107.404893971860
7497.016128263142990.1359449640257103.896311562260
7589.824580684651981.19277068042898.4563906888758
7684.118832722883873.85931543910894.3783500066596
7776.609598207694964.785603341392788.433593073997
7877.212191567353263.85640995101190.5679731836954
79114.63857977246799.7661516459297129.511007899004
80122.086910381982105.702015462796138.471805301168
81119.472656255579101.572232475334137.373080035825
82107.82926884905888.405274205693127.253263492423
8396.633834794469175.6747019350271117.592967653911
8493.511572240998871.0031849601905116.019959521807
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/1topz1211813915.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/1topz1211813915.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/253e41211813915.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/253e41211813915.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/3e2661211813915.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/26/t12118139862lmupso6qc5svd5/3e2661211813915.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=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