Home » date » 2010 » Dec » 22 »

Opgave10 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, 22 Dec 2010 12:32:43 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq.htm/, Retrieved Wed, 22 Dec 2010 13:33:34 +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/Dec/22/t1293021211ynd2qrgc1y8unmq.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:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
105,23 105,22 105,13 105 105,01 105,01 105,01 105,01 105,57 106,05 106,09 106,2 106,19 106,2 106,09 106,23 106,23 106,22 106,22 106,61 106,95 107,74 107,8 107,8 107,2 107,56 107,72 108,14 108,16 108,16 108,16 108,1 108,95 110,49 110,72 110,82 110,82 110,75 110,71 110,86 110,84 110,84 110,84 110,92 111,46 112,46 113,04 113,15 113,15 113,21 113,37 113,47 113,71 113,71 113,71 113,8 115,46 117 117,94 118,08 118,08 118,47 118,49 118,45 118,54 118,55 118,55 118,55 119,04 121,37 122 122,14
 
Output produced by software:


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


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.938027433409238
beta0.0620541839691078
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13106.19105.6139823717950.576017628205136
14106.2106.1901380822280.00986191777190015
15106.09106.108714919066-0.0187149190664542
16106.23106.24564653112-0.0156465311200549
17106.23106.230795613716-0.00079561371580894
18106.22106.223578952746-0.00357895274564157
19106.22106.357293117842-0.137293117841750
20106.61106.2809214310300.329078568970289
21106.95107.221174359354-0.271174359353694
22107.74107.4921722472620.247827752737777
23107.8107.813600709393-0.0136007093935007
24107.8107.959843758246-0.159843758246112
25107.2107.875716503113-0.675716503112625
26107.56107.2013205855970.358679414403014
27107.72107.4243264252750.295673574724916
28108.14107.8536529179050.286347082095475
29108.16108.1378789400180.0221210599816288
30108.16108.168198498953-0.00819849895314917
31108.16108.305236137954-0.145236137954029
32108.1108.265796924267-0.165796924267383
33108.95108.6913188692480.258681130752166
34110.49109.5090167631380.980983236862315
35110.72110.5621568178560.157843182143907
36110.82110.930328407856-0.110328407855775
37110.82110.933732692014-0.113732692013883
38110.75110.956364166402-0.206364166401798
39110.71110.718315628215-0.00831562821501564
40110.86110.917095794235-0.0570957942349679
41110.84110.897978779773-0.0579787797726681
42110.84110.881811585024-0.0418115850237086
43110.84111.007398159038-0.167398159037560
44110.92110.973177644372-0.0531776443720844
45111.46111.564482447818-0.104482447818015
46112.46112.0989835304860.361016469514482
47113.04112.4961759684300.543824031570168
48113.15113.208866599562-0.0588665995624922
49113.15113.262405712819-0.112405712818855
50113.21113.282691774758-0.0726917747575726
51113.37113.1922365111280.177763488871747
52113.47113.583303680854-0.113303680854344
53113.71113.5288983467890.181101653211215
54113.71113.769404540243-0.059404540242511
55113.71113.901088918017-0.191088918017215
56113.8113.880728756492-0.0807287564916521
57115.46114.4704110574790.989588942521038
58117116.1511142519010.848885748098681
59117.94117.1367536337810.803246366219327
60118.08118.190022961225-0.110022961224772
61118.08118.323864025975-0.243864025974972
62118.47118.3472537421220.122746257877736
63118.49118.590976213751-0.100976213751323
64118.45118.821644832206-0.371644832205973
65118.54118.647220923428-0.107220923428486
66118.55118.689652470034-0.139652470033809
67118.55118.820514781338-0.270514781337923
68118.55118.810480533070-0.260480533069696
69119.04119.365408234687-0.325408234687316
70121.37119.7948713787461.57512862125446
71122121.4921747519620.507825248037676
72122.14122.227793936455-0.0877939364546307


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
73122.391546495267121.649783695245123.13330929529
74122.697956637059121.650918023435123.744995250682
75122.837079715853121.530157807041124.144001624664
76123.175975060776121.630269527286124.721680594266
77123.418466423437121.645474457061125.191458389814
78123.617620638530121.623966175420125.611275101641
79123.937656256187121.727134393499126.148178118876
80124.264025740627121.838644251646126.689407229608
81125.156461378494122.517031137683127.795891619305
82126.125082841271123.27157880495128.978586877592
83126.303178231142123.234972936919129.371383525365
84126.520420996310123.236442339935129.804399652685
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/15lc71293021160.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/15lc71293021160.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/25lc71293021160.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/25lc71293021160.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/3gvbb1293021160.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293021211ynd2qrgc1y8unmq/3gvbb1293021160.ps (open in new window)


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