Home » date » 2010 » Jan » 16 »

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: Sat, 16 Jan 2010 10:09:08 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s.htm/, Retrieved Sat, 16 Jan 2010 18:10:07 +0100
 
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/Jan/16/t1263661803uldper14cwcef0s.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:
KDGP2W62
 
Dataseries X:
» Textbox « » Textfile « » CSV «
10 15 12 13 12 15 13 13 16 14 12 15 14 19 16 16 11 13 12 11 6 9 6 15 17 13 12 13 10 14 13 10 11 12 7 11 9 13 12 5 13 11 8 8 8 8 0 3 0 -1 -1 -4 1 -1 0 -1 6 0 -3 -3
 
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.635345371205515
beta0.281122102631007
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
31220-8
41318.4883600171545-5.4883600171545
51217.5922049379589-5.5922049379589
61515.6312508328869-0.631250832886929
71316.7094684796509-3.70946847965089
81315.1694080127592-2.16940801275921
91614.22034067967291.77965932032705
101416.0981592840101-2.09815928401006
111215.1374723413373-3.13747234133733
121512.95607989494682.04392010505323
131414.431724962636-0.431724962636004
141914.25737016142914.74262983857086
151618.2175970769512-2.21759707695120
161617.3595918531815-1.35959185318151
171116.8038800835107-5.80388008351069
181312.38788150355890.612118496441143
191212.1575881791556-0.157588179155598
201111.4101185153825-0.410118515382502
21610.4289537564839-4.42895375648388
2296.103386852617432.89661314738257
2366.94944796538283-0.94944796538283
24155.182351406158419.8176485938416
251712.00960635708874.99039364291132
261316.6612195647143-3.66121956471428
271215.1621413078765-3.16214130787654
281313.4153612329751-0.415361232975057
291013.3395476496351-3.33954764963514
301410.80939040304643.19060959695359
311312.99801192522030.00198807477968899
321013.1611126120489-3.1611126120489
331110.74994677540680.250053224593248
341210.55071127657691.44928872342315
35711.3722614187128-4.37226141871278
36117.71418864518863.28581135481140
3799.50851450000374-0.508514500003741
38138.801307401124814.19869259887519
391211.83472946132830.165270538671715
40512.3350543946717-7.3350543946717
41136.759971272187056.24002872781295
421110.92428357666410.0757164233358534
43811.1856522739298-3.18565227392982
4488.80593730230932-0.805937302309315
4587.794215062027450.205784937972554
4687.462041034995840.537958965004157
4707.43699688836597-7.43699688836597
4831.016782217099521.98321778290048
4900.935879120754331-0.935879120754331
50-1-1.166815701775920.166815701775916
51-1-2.53912358274571.5391235827457
52-4-2.7646397151898-1.2353602848102
531-4.973558569618315.97355856961831
54-1-1.535389132597050.535389132597048
550-1.456709822132831.45670982213283
56-1-0.532491278707392-0.467508721292608
576-0.9143176382008976.9143176382009
5804.62882890275241-4.62882890275241
59-32.01133731761596-5.01133731761596
60-3-1.74425230566867-1.25574769433133


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
61-3.33803407250328-10.53535347559143.85928533058483
62-4.13398235434248-13.41412332008475.14615861139974
63-4.92993063618169-16.6412482796726.78138700730863
64-5.72587891802089-20.15530423752478.70354640148296
65-6.52182719986009-23.916830887997310.8731764882772
66-7.3177754816993-27.899163927993813.2636129645952
67-8.1137237635385-32.083195616398315.8557480893213
68-8.9096720453777-36.454495870311718.6351517795563
69-9.7056203272169-41.001687827066421.5904471726326
70-10.5015686090561-45.715489432837224.712352214725
71-11.2975168908953-50.588120483673627.9930867018830
72-12.0934651727345-55.612918849361831.4259885038928
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/1yplf1263661746.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/1yplf1263661746.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/2gab21263661746.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/2gab21263661746.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/3d9151263661747.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/16/t1263661803uldper14cwcef0s/3d9151263661747.ps (open in new window)


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