Home » date » 2011 » May » 18 »

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, 18 May 2011 14:45:50 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0.htm/, Retrieved Wed, 18 May 2011 16:42:04 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
10407 10463 10556 10646 10702 11353 11346 11451 11964 12574 13031 13812 14544 14931 14886 16005 17064 15168 16050 15839 15137 14954 15648 15305 15579 16348 15928 16171 15937 15713 15594 15683 16438 17032 17696 17745 19394 20148 20108 18584 18441 18391 19178 18079 18483 19644 19195 19650 20830 23595 22937 21814 21928 21777 21383 21467 22052 22680 24320 24977 25204 25739 26434 27525 30695 32436 30160 30236 31293 31077 32226 33865 32810
 
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' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.750102276552439
beta0
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
131454412099.21868267272444.78131732733
141493114291.259502767639.740497233011
151488614765.9690523822120.030947617797
161600516100.4734136235-95.4734136235274
171706417248.8405028966-184.840502896604
181516815385.4286115819-217.428611581863
191605015329.3374432133720.66255678666
201583915873.6076945031-34.6076945031036
211513716406.8319429242-1269.83194292422
221495416074.9307559364-1120.93075593644
231564815552.010210990195.9897890098891
241530516401.9298589301-1096.92985893007
251557917070.6652162102-1491.6652162102
261634815808.8014881881539.198511811861
271592816036.041507764-108.041507763966
281617117204.1981776734-1033.19817767338
291593717647.8114703688-1710.81147036876
301571314716.2093422803996.790657719728
311559415799.0279129557-205.027912955695
321568315473.2452562242209.754743775791
331643815862.8434427541575.156557245855
341703216959.92613674572.0738632550274
351769617674.182561174721.8174388253137
361774518171.4009909518-426.400990951781
371939419384.32379927939.67620072072168
382014819750.8963904935397.103609506477
392010819552.9503332592555.049666740753
401858421137.1105538536-2553.1105538536
411844120357.3900045254-1916.39000452539
421839117686.5619729097704.438027090298
431917818200.1027579782977.897242021772
441807918778.4634748238-699.463474823802
451848318571.2639401369-88.263940136887
461964419070.336672515573.663327484977
471919520192.2929897825-997.292989782534
481965019813.3870639623-163.387063962331
492083021472.1276817113-642.127681711321
502359521452.03865763462142.96134236536
512293722482.4865559503454.513444049659
522181423147.2133687415-1333.21336874153
532192823575.1447561781-1647.14475617815
542177721558.0800507517218.919949248277
552138321711.350736046-328.350736046024
562146720777.1487256761689.851274323933
572205221789.0561450684262.943854931636
582268022787.2031352412-107.203135241176
592432022988.47359475571331.52640524428
602497724622.8935853504354.106414649643
612520426890.8567459665-1686.85674596648
622573926916.3592139628-1177.35921396278
632643424892.25437702441541.74562297558
642752525844.54319850531680.45680149475
653069528665.03772166082029.96227833919
663243629619.82495952582816.17504047418
673016031357.4522765505-1197.45227655049
683023629694.2412564194541.758743580576
693129330509.0212752618783.978724738154
703107731956.4878608999-879.48786089995
713222632031.7211939538194.278806046157
723386532582.61460566721282.38539433278
733281035397.227656543-2587.22765654298


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
7435202.996799278632961.990767370237444.002831187
7534415.090438142131646.315537312337183.8653389719
7634061.710927828430857.200037518237266.2218181387
7735980.379737451632259.539332933839701.2201419693
7835427.765921405331417.064266667439438.4675761432
7933881.653084496229701.946599430438061.3595695621
8033467.111585056629036.841462251437897.3817078617
8133946.099536255529191.97018195438700.228890557
8234393.776833389329338.085032536839449.4686342417
8335467.088207369730046.198410869640887.9780038697
8436167.134963855330444.027823937141890.2421037734
8537048.962458201131440.280385403642657.6445309987
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/14ark1305729947.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/14ark1305729947.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/261wl1305729947.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/261wl1305729947.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/3vpl81305729947.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057297213cihhqnape7ihb0/3vpl81305729947.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=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