Home » date » 2009 » Jun » 02 »

Opgave 10 Oefening 2 Anke Winckelmans

*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 06:23:00 -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/t1243945617c3shpjb71jj8wyq.htm/, Retrieved Tue, 02 Jun 2009 14:27:00 +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/t1243945617c3shpjb71jj8wyq.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 «
3779,7 3795,5 3813,1 3826,9 3833,3 3844,8 3851,3 3851,8 3854,1 3858,4 3861,6 3856,3 3855,8 3860,4 3855,1 3839,5 3833 3833,6 3826,8 3818,2 3811,4 3806,8 3810,3 3818,2 3858,9 3867,8 3872,3 3873,3 3876,7 3882,6 3883,5 3882,2 3888,1 3893,7 3901,9 3914,3 3930,3 3948,3 3971,5 3990,1 3993 3998 4015,8 4041,2 4060,7 4076,7 4103 4125,3 4139,7 4146,7 4158 4155,1 4144,8 4148,2 4142,5 4142,1 4145,4 4146,3 4143,5 4149,2 4158,9 4166,1 4179,1 4194,4 4211,7 4226,3 4235,8 4243,6 4258,7 4278,2 4298 4315,1 4334,3 4356 4374 4395,5
 
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'George Udny Yule' @ 72.249.76.132


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.892317039957039
beta0.637835382133787
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
133855.83849.530093874086.26990612591726
143860.43864.82369864823-4.42369864822604
153855.13858.91748719337-3.81748719336747
163839.53841.8247905871-2.32479058710305
1738333834.19969985771-1.19969985770558
183833.63833.433643147850.166356852148510
193826.83840.93065989168-14.1306598916790
203818.23811.003264130817.19673586919407
213811.43807.420245370093.97975462991508
223806.83807.36773811876-0.567738118757461
233810.33803.582276883316.71772311669474
243818.23802.7181819395715.4818180604279
253858.93824.8922684274334.0077315725721
263867.83887.21966999135-19.4196699913455
273872.33882.88471468827-10.5847146882652
283873.33870.867095599542.4329044004603
293876.73881.29822741484-4.59822741484231
303882.63889.48576212567-6.88576212567432
313883.53897.06539473905-13.5653947390542
323882.23877.996791390124.20320860987795
333888.13877.7511786362710.3488213637256
343893.73892.947572239020.752427760975479
353901.93901.98838317014-0.0883831701371491
363914.33902.8022242026211.4977757973820
373930.33928.115218635622.18478136437625
383948.33942.793507388775.5064926112309
393971.53962.314364045759.18563595424848
403990.13980.989048348679.11095165133156
4139934012.23183109414-19.2318310941419
4239984014.61995026851-16.6199502685085
434015.84014.904390351630.895609648369827
444041.24020.6751481352120.5248518647863
454060.74054.920281507155.77971849284768
464076.74081.77150743348-5.07150743348393
4741034099.12638643333.87361356669680
484125.34120.267194726265.03280527374227
494139.74150.96422013967-11.2642201396657
504146.74158.38153890182-11.6815389018202
5141584157.497209183010.502790816988636
524155.14157.58286774021-2.48286774021199
534144.84158.25524055099-13.4552405509930
544148.24152.60315481844-4.40315481843663
554142.54159.38170602198-16.8817060219781
564142.14134.579999455947.52000054405744
574145.44131.3165853596514.0834146403540
584146.34144.89582931941.40417068059924
594143.54153.23768022431-9.73768022430613
604149.24138.7665828693310.4334171306718
614158.94152.035400781096.86459921891128
624166.14165.402959220010.697040779987219
634179.14173.741277220545.35872277946328
644194.44177.4100184224816.9899815775198
654211.74204.896546883036.80345311696783
664226.34240.63916135374-14.3391613537424
674235.84254.0367061512-18.2367061512032
684243.64246.60749624002-3.0074962400231
694258.74244.455250007114.2447499928994
704278.24266.7173205261211.4826794738838
7142984298.66598326539-0.665983265386785
724315.14315.30603415217-0.206034152173743
734334.34333.536283599730.763716400270823
7443564352.126273234573.87372676542873
7543744376.9981395221-2.99813952209843
764395.54382.358716474613.1412835254023


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
774411.069167595034390.65248805974431.48584713037
784440.927948296454404.751746308544477.10415028436
794477.687528592774422.537319758644532.83773742690
804509.34927027154432.644540739594586.0539998034
814534.246720712744433.813401196114634.68004022937
824557.809576420294431.638863473404683.98028936718
834586.28155767484432.339155288694740.2239600609
844611.841934618194428.439030750324795.24483848606
854638.847751150044424.251858225334853.44364407474
864665.095018198834417.747703285214912.44233311245
874691.58591079274409.958031145624973.21379043979
884708.198321442784392.155772222945024.24087066262
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/1sc5p1243945377.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/1sc5p1243945377.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/22ilc1243945377.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/22ilc1243945377.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/35ny71243945377.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243945617c3shpjb71jj8wyq/35ny71243945377.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