Home » date » 2010 » Aug » 19 »

stap 33 exponential smoothing

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Thu, 19 Aug 2010 13:26:45 +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/Aug/19/t1282224442g50s7apxf1e6kqa.htm/, Retrieved Thu, 19 Aug 2010 15:28:20 +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/2010/Aug/19/t1282224442g50s7apxf1e6kqa.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:
Philippe De Vocht
 
Dataseries X:
» Textbox « » Textfile « » CSV «
73 72 71 69 89 88 73 63 64 64 65 67 69 71 70 72 88 83 76 70 75 71 75 81 87 90 80 85 105 104 98 94 107 112 121 118 120 122 109 112 132 127 116 113 123 125 137 127 123 128 114 120 143 135 119 117 132 139 158 141 139 150 142 149 166 150 139 140 158 169 186 177 175 187 176 185 204 188 171 171 182 185 200 192 185 195 190 195 213 194 171 171 186 182 193 185 172 185 179 182 193 173 155 164 188 186 200 185 173 190 190 193 195 178 163 165 188 182 200 177
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.666695305515088
beta0.0185297170665319
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
371710
46970-1
58968.320951019104120.6790489808959
68881.35068448009646.64931551990357
77385.1090039904545-12.1090039904545
86376.2116492394221-13.2116492394221
96466.4159536513059-2.41595365130593
106463.78785172441350.212148275586472
116562.91451382552462.08548617447537
126763.3158849286793.68411507132097
136964.82856677427774.1714332257223
147166.71767387765124.28232612234882
157068.73361522141071.26638477858934
167268.75448713603873.24551286396132
178870.134928466562817.8650715334372
188381.48286022510741.51713977489263
197681.9504448776355-5.95044487763555
207077.3659160343971-7.36591603439715
217571.74670308028283.25329691971724
227173.2474597250049-2.2474597250049
237571.05312335003583.94687664996421
248173.03728038994167.96271961005844
258777.79714993223889.20285006776119
269083.49749765122796.50250234877214
278087.477866025888-7.47786602588803
288582.04520930636592.95479069363412
2910583.604458370846921.3955416291531
3010497.7223830900946.2776169099061
3198101.838810011358-3.83881001135829
329499.1632391829005-5.16323918290045
3310795.540892662509311.4591073374907
34112103.1421486261098.8578513738911
35121109.11858647077811.8814135292222
36118117.2575981361440.742401863856216
37120117.9794544077612.02054559223934
38122119.5784042672032.42159573279731
39109121.474647980217-12.4746479802173
40112113.285528188319-1.28552818831938
41132112.54026103659419.4597389634056
42127125.8661654047291.13383459527054
43116126.988282385836-10.9882823858359
44113119.892895209147-6.89289520914699
45123115.4427308475767.55726915242428
46125120.719783279664.28021672034031
47137123.86491664726913.1350833527311
48127133.075814585494-6.07581458549441
49123129.403838412512-6.40383841251247
50128125.4340593530212.56594064697863
51114127.4760886818-13.4760886817996
52120118.6564931411691.34350685883147
53143119.73364962471423.2663503752856
54135135.714087904054-0.714087904053855
55119135.698058948203-16.6980589482034
56117124.819309133994-7.81930913399405
57132119.76338293301812.2366170669823
58139128.22981577299410.7701842270062
59158135.85163608243622.1483639175637
60141151.332849074934-10.3328490749335
61139145.031341184667-6.03134118466684
62150141.5231191803718.47688081962903
63142147.792181311597-5.79218131159712
64149144.4765719781624.52342802183841
65166148.09421192224517.9057880777547
66150160.855010785671-10.8550107856706
67139154.307020784486-15.3070207844856
68140144.601798651166-4.60179865116598
69158141.97684873192316.0231512680775
70169153.30040090966515.6995990903345
71186164.60219012018821.3978098798116
72177179.967291311006-2.96729131100591
73175179.051636965889-4.05163696588895
74187177.3630018552689.63699814473156
75176184.919567858533-8.91956785853279
76185179.9943689750795.00563102492123
77204184.41487275634519.5851272436547
78188198.797406527676-10.7974065276758
79171192.790660008809-21.7906600088094
80171179.185568261652-8.1855682616521
81182174.5498054603157.45019453968504
82185180.4303696016444.56963039835631
83200184.44692688326515.5530731167351
84192195.978231480081-3.97823148008075
85185194.43896121132-9.43896121131974
86195189.1424422033195.85755779668142
87190194.116402976218-4.11640297621847
88195192.389918218332.61008178167032
89213195.18019337419217.8198066258078
90194208.330860788221-14.3308607882209
91171199.869790366035-28.8697903660349
92171181.359035828613-10.3590358286127
93186175.06134227694710.9386577230526
94182183.097853661088-1.09785366108844
95193183.0961168828999.903883117101
96185190.551535724279-5.551535724279
97172187.634317509139-15.634317509139
98185177.8018147281927.19818527180817
99179183.280558408641-4.28055840864096
100182181.0535969350950.946403064905155
101193182.32311769431310.6768823056866
102173190.211802021856-17.2118020218562
103155179.294602416338-24.2946024163377
104164163.3552054061610.644794593838554
105188164.05075288814623.9492471118537
106186180.5791306859255.42086931407496
107200184.82169364690215.1783063530976
108185195.757001945171-10.7570019451714
109173189.268473443797-16.2684734437969
110190178.90449732794311.0955026720569
111190186.9210258669533.07897413304687
112193189.6310091094233.36899089057707
113195192.5759645824822.42403541751816
114178194.920868424391-16.9208684243911
115163184.159580773583-21.1595807735828
116165170.310964906069-5.31096490606942
117188166.96293689993121.0370631000692
118182181.4409005235680.559099476431896
119200182.27320886625517.7267911337449
120177194.770127666612-17.7701276666124


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
121183.381890953853161.11375555955205.650026348156
122183.840914934828156.924021136214210.757808733441
123184.299938915802153.290849553622215.309028277982
124184.758962896777150.014833025366219.503092768189
125185.217986877752146.989158269221223.446815486282
126185.677010858727144.148932351368227.205089366085
127186.136034839701141.45136390676230.820705772643
128186.595058820676138.866553448505234.323564192847
129187.054082801651136.372686972348237.735478630953
130187.513106782625133.953307086532241.072906478719
131187.9721307636131.595660862018244.348600665182
132188.431154744575129.289647483546247.572662005604
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/1yxqy1282224400.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/1yxqy1282224400.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/2qo711282224400.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/2qo711282224400.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/3qo711282224400.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282224442g50s7apxf1e6kqa/3qo711282224400.ps (open in new window)


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