Home » date » 2009 » Jun » 06 »

Jurgen Leemans - opgave 10 - oef 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, 06 Jun 2009 07:00:06 -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/Jun/06/t1244293479yf24fmv1kk9i4iy.htm/, Retrieved Sat, 06 Jun 2009 15:04:42 +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/Jun/06/t1244293479yf24fmv1kk9i4iy.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 «
163.40 162.89 162.29 161.26 161.43 161.44 161.44 161.44 161.92 162.23 161.89 161.40 161.40 159.55 158.93 158.59 158.29 158.03 158.03 163.94 164.36 164.39 163.22 163.22 163.56 162.82 162.80 162.44 161.98 161.53 161.53 161.52 162.07 161.84 161.54 161.47 161.47 161.54 161.57 160.75 160.31 160.57 160.57 159.65 158.76 158.95 159.25 158.72 158.72 158.72 158.53 157.92 157.89 157.81 157.81 157.88 157.52 156.11 155.61 155.31 155.31 155.31 153.09 151.94 151.73 151.65 151.65 151.09 149.94 149.47 149.15 149.22
 
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' @ 72.249.127.135


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.887063362952135
beta0
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13161.4162.988408119658-1.58840811965817
14159.55159.670954156608-0.120954156608377
15158.93158.6414748409990.288525159000983
16158.59158.269396290820.320603709179949
17158.29158.0120234472420.277976552758474
18158.03157.7710042816010.258995718398666
19158.03160.398564579869-2.36856457986894
20163.94158.4236457369295.51635426307092
21164.36163.9798161860790.380183813921235
22164.39164.781961337244-0.391961337243742
23163.22164.239998147262-1.01999814726244
24163.22163.0217598458620.198240154138404
25163.56163.2060366376850.353963362315312
26162.82161.7773185691461.04268143085397
27162.8161.8263029678470.973697032152614
28162.44162.0656381272450.374361872754861
29161.98161.8511380133400.128861986659700
30161.53161.4757011476300.0542988523695271
31161.53163.624934531806-2.09493453180568
32161.52162.783239097023-1.26323909702256
33162.07161.7454188428880.324581157111794
34161.84162.411037437629-0.571037437629315
35161.54161.63929403455-0.0992940345498994
36161.47161.3753623565390.094637643461141
37161.47161.485324012272-0.0153240122720888
38161.54159.8068061458711.73319385412901
39161.57160.4605279509251.10947204907515
40160.75160.752617256072-0.00261725607185781
41160.31160.1759868368560.134013163144033
42160.57159.7966984814470.773301518552955
43160.57162.341005598019-1.77100559801872
44159.65161.880584538051-2.23058453805066
45158.76160.1639906636-1.40399066359993
46158.95159.195108373789-0.245108373788639
47159.25158.7657618156570.484238184343127
48158.72159.041362181660-0.321362181659623
49158.72158.769886933931-0.0498869339310204
50158.72157.2581812936591.46181870634086
51158.53157.6007351043780.929264895621799
52157.92157.6073736197350.312626380265328
53157.89157.3258148607820.564185139218011
54157.81157.4003153820810.409684617919282
55157.81159.334725778587-1.52472577858745
56157.88159.040867223526-1.16086722352611
57157.52158.366533119890-0.846533119890438
58156.11158.023031262051-1.91303126205071
59155.61156.196501365030-0.586501365030216
60155.31155.431306109379-0.121306109379105
61155.31155.367952775427-0.0579527754268554
62155.31154.0198191738911.29018082610878
63153.09154.149974472932-1.05997447293200
64151.94152.322390544104-0.382390544103799
65151.73151.4527179351680.277282064832377
66151.65151.2552684811630.394731518837091
67151.65152.957948726459-1.30794872645936
68151.09152.897478113839-1.80747811383932
69149.94151.685059015895-1.74505901589504
70149.47150.424061041452-0.95406104145249
71149.15149.598012318800-0.448012318799755
72149.22149.0082032099740.211796790026256


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
73149.247488166659146.861643746193151.633332587126
74148.103016024235144.913755587103151.292276461367
75146.823280544838142.995681993129150.650879096546
76146.012485186851141.638740885886150.386229487817
77145.556518425935140.697632983016150.415403868854
78145.126366557372139.826565024805150.426168089939
79146.286599953234140.579847389667151.993352516801
80147.329947567359141.243392436666153.416502698052
81147.727925486548141.283914166249154.171936806848
82148.104238082441141.321582965650154.886893199232
83148.181653396599141.076476483213155.286830309986
84148.063776223776140.650095120053155.477457327499
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/18k491244293204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/18k491244293204.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/2e6eq1244293204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/2e6eq1244293204.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/3tzu61244293204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/06/t1244293479yf24fmv1kk9i4iy/3tzu61244293204.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