Home » date » 2009 » Jun » 03 »

Opgave 10, oefening 2

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Wed, 03 Jun 2009 06:04:30 -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/03/t1244030698c6kfh8rfemsp72j.htm/, Retrieved Wed, 03 Jun 2009 14:05:02 +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/03/t1244030698c6kfh8rfemsp72j.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 «
41 39 50 40 43 38 44 35 39 35 29 49 50 59 63 32 47 53 60 57 52 70 90 74 62 55 84 94 70 108 139 120 97 126 149 158 124 140 109 114 77 120 133 110 92 97 78 99 107 112 90 98 125 155 190 236 189 174 178 136 161 171 149 184 155 276 224 213 279 268 287 238 213 257 293 212 246 353 339 308 247 257 322 298 273 312 249 286 279 309 401 309 328 353 354 327 324 285 243 241 287 355 460 364 487 452 391 500 451 375 372 302 316 398 394 431 431
 
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.211758486366268
beta0.00338345770218744
gamma0.436282320230838


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
135044.98187815845335.01812184154671
145954.29453003654974.70546996345035
156359.12290921706873.87709078293130
163230.14848539289341.85151460710664
174742.79370501932434.20629498067568
185347.52829180551325.47170819448682
196059.26605015560750.733949844392491
205747.10881827908759.8911817209125
215254.3911775331105-2.3911775331105
227049.296529701070720.7034702989293
239045.636208132833244.3637918671668
247492.9972836592548-18.9972836592548
256293.2273628458895-31.2273628458895
265599.8920133561325-44.8920133561325
278494.9056693010717-10.9056693010717
289446.044778684406447.9552213155936
297078.7271848301798-8.72718483017984
3010883.187233553906824.8127664460932
31139102.99714096911636.0028590308844
3212092.349355917214627.6506440827854
339798.968774832317-1.96877483231704
34126102.66659783647623.3334021635236
35149102.28770881136946.7122911886312
36158136.70111460453221.2988853954675
37124138.942725926159-14.9427259261588
38140147.113941927190-7.11394192719041
39109175.358308233225-66.3583082332254
40114107.2414308118786.75856918812161
4177112.530655571416-35.5306555714160
42120129.048900838430-9.04890083842955
43133149.610080578132-16.6100805781318
44110120.021859777717-10.0218597777165
4592107.427038899669-15.4270388996686
4697117.269087621380-20.2690876213804
4778114.214210369593-36.2142103695933
4899119.609962720668-20.6099627206684
49107103.9149018388293.08509816117078
50112115.955690292417-3.95569029241652
5190121.240818319716-31.2408183197158
529890.78020586521437.21979413478573
5312582.795255781984642.2047442180154
54155124.40947332343930.5905266765607
55190151.57569467286038.4243053271405
56236132.351631649902103.648368350098
57189137.07063300523351.9293669947672
58174164.2393521375769.76064786242446
59178157.63453171991120.3654682800888
60136192.326069971329-56.326069971329
61161174.29687080369-13.2968708036901
62171185.236946979371-14.2369469793711
63149175.285000998686-26.2850009986861
64184151.63638839987632.3636116001242
65155159.634391727341-4.63439172734067
66276200.04744809362775.9525519063732
67224250.039308392898-26.0393083928978
68213229.784089747381-16.7840897473808
69279182.69116345223896.3088365477616
70268204.79224168246563.207758317535
71287211.14191286179275.8580871382076
72238230.4780089487477.52199105125348
73213243.992291100576-30.9922911005764
74257255.9057516330041.09424836699591
75293239.20568784691553.794312153085
76212252.491739446472-40.4917394464719
77246226.80065006415119.1993499358493
78353328.9157829461524.0842170538502
79339331.5758645846117.42413541538883
80308316.113103317822-8.1131033178217
81247302.478464059447-55.4784640594471
82257276.864482290498-19.8644822904984
83322267.29967801787254.7003219821281
84298256.43169125584441.5683087441556
85273263.2219768854519.77802311454889
86312299.57185318309512.4281468169047
87249302.366843781185-53.3668437811846
88286257.37757120958428.6224287904157
89279267.02091424160711.9790857583935
90309382.363034867825-73.3630348678246
91401357.88523134466243.1147686553378
92309342.348465368962-33.3484653689624
93328303.95886266752124.0411373324789
94353306.88446876452446.1155312354764
95354339.61187003829714.388129961703
96327310.86521330632516.1347866936754
97324299.52513948375924.4748605162409
98285344.375760255379-59.3757602553791
99243306.569038451894-63.5690384518942
100241286.829349354318-45.829349354318
101287274.83302281321212.1669771867881
102355360.817478409014-5.81747840901437
103460391.79431987725368.2056801227468
104364351.61903473423912.380965265761
105487341.247215884008145.752784115992
106452377.66567604967674.334323950324
107391407.361668786917-16.3616687869167
108500367.373824315778132.626175684222
109451380.3242650370370.6757349629697
110375407.70415901952-32.70415901952
111372364.8789558729647.12104412703633
112302365.085961335209-63.085961335209
113316375.101472657518-59.1014726575185
114398461.649595401111-63.649595401111
115394519.019844851991-125.019844851991
116431407.67759764510423.3224023548963
117431445.427876451213-14.4278764512130


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
118421.252994457504374.109634423978468.396354491029
119403.781873008052353.602308462305453.961437553798
120415.312127710863361.700106392753468.924149028973
121380.095834046952324.996981426188435.194686667717
122358.948344719755302.095734876109415.800954563402
123338.45747626022280.121173973430396.79377854701
124314.335338085329255.049355209065373.621320961593
125337.195230666006273.360929072824401.029532259187
126432.526150001749356.43779404065508.614505962848
127480.543647622941396.829771857601564.257523388282
128444.109488595475363.045642774212525.173334416738
129464.870756492779386.981794380782542.759718604775
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/11mb81244030667.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/11mb81244030667.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/2zort1244030667.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/2zort1244030667.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/3n81h1244030667.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030698c6kfh8rfemsp72j/3n81h1244030667.ps (open in new window)


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