Home » date » 2009 » Jun » 02 »

opgave 10-oefening 2- elke torfs mar 201

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Tue, 02 Jun 2009 08:16:46 -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/02/t1243952266jl5dr8qx9plle5i.htm/, Retrieved Tue, 02 Jun 2009 16:17:50 +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/02/t1243952266jl5dr8qx9plle5i.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 «
356445 291705 310900 332340 257166 334551 317365 270863 317904 423141 317684 411063 371161 299023 326964 327146 303447 351994 320317 257151 320274 476982 301723 363567 338831 265802 307691 334207 303127 318863 292123 245155 284794 391604 304982 369552 356021 247577 277885 294032 310845 311023 298462 234188 297478 371017 291128 316374 326001 222302 227424 255428 278250 280335 241894 255075 255115 319482 270694 300209 283531 218924 236466 267980 219994 256052 230444 200778 240960 277837 209776 232065
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.147667823524466
beta0.124242853591504
gamma0.292533149520714


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13371161361157.91509030910003.0849096908
14299023293480.2232094575542.77679054317
15326964323388.0427461083575.95725389244
16327146323045.4507206064100.54927939392
17303447299982.3609681863464.63903181400
18351994352748.677695795-754.67769579502
19320317326917.034848067-6600.03484806692
20257151278431.175896412-21280.1758964119
21320274322885.822104651-2611.82210465142
22476982429590.00061524947391.9993847507
23301723327430.411907507-25707.411907507
24363567416559.126517708-52992.1265177078
25338831370781.708270665-31950.7082706649
26265802294297.353265327-28495.3532653265
27307691316049.58595791-8358.5859579101
28334207311809.85800480422397.1419951958
29303127290189.70072249512937.2992775055
30318863339838.660850376-20975.6608503757
31292123308708.708341529-16585.7083415294
32245155255999.928903402-10844.9289034021
33284794301593.359756330-16799.3597563303
34391604406909.956302716-15305.9563027158
35304982286634.18898571818347.8110142816
36369552364816.4674734924735.53252650757
37356021333449.31945737622571.6805426237
38247577269362.671005350-21785.6710053502
39277885294653.697907713-16768.6979077131
40294032295671.763292971-1639.76329297089
41310845269139.19554495941705.8044550411
42311023311206.657278730-183.657278730476
43298462285577.40279554812884.5972044519
44234188241210.153113655-7022.15311365537
45297478284077.49906606413400.5009339358
46371017392163.73739877-21146.7373987695
47291128283399.9974027197728.00259728072
48316374355076.83749303-38702.8374930298
49326001322936.1205282193064.87947178097
50222302248886.550308959-26584.5503089590
51227424272390.39427674-44966.39427674
52255428271352.536469898-15924.5364698984
53278250253349.0613199724900.9386800301
54280335278183.8848708832151.11512911710
55241894256885.912955354-14991.9129553536
56255075208045.47880117647029.5211988241
57255115258255.514490803-3140.51449080318
58319482343012.819417679-23530.8194176793
59270694251177.37400412719516.6259958728
60300209304969.700391699-4760.70039169939
61283531289256.273223095-5725.27322309453
62218924214825.6590619114098.34093808889
63236466235713.103595418752.896404582309
64267980248404.32991008719575.6700899135
65219994247414.126846901-27420.1268469013
66256052258092.299543123-2040.29954312256
67230444234149.675240082-3705.67524008173
68200778204689.920864555-3911.92086455479
69240960231211.1590050879748.84099491325
70277837304676.136356123-26839.1363561229
71209776230253.009807971-20477.0098079710
72232065265177.70131122-33112.7013112198


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
73245284.756237227229107.042437408261462.470037046
74183101.802187382166130.785475117200072.818899648
75197950.651322263179082.590229975216818.712414552
76210632.287350266189419.6395728231844.935127732
77195738.26560289173250.808965976218225.722239804
78211446.175941396185578.812880892237313.539001899
79190121.875229136163585.742718653216658.00773962
80165123.004770323138597.231209813191648.778330833
81188421.627648825156498.093646389220345.16165126
82236652.735908474194534.003945037278771.467871911
83179832.658266007143315.356784557216349.959747457
84206684.005369926164914.322234310248453.688505542
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/1lu5v1243952204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/1lu5v1243952204.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/25jmk1243952204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/25jmk1243952204.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/36u2d1243952204.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243952266jl5dr8qx9plle5i/36u2d1243952204.ps (open in new window)


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