Home » date » 2010 » Jan » 19 »

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: Tue, 19 Jan 2010 10:48:25 -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/19/t1263923353sboft419iinsbb9.htm/, Retrieved Tue, 19 Jan 2010 18:49:17 +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/19/t1263923353sboft419iinsbb9.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 «
100,09 100,09 100,06 100,11 100,08 100,08 100,08 100,08 99,94 99,79 99,98 99,98 99,98 99,98 99,93 99,93 99,93 99,93 99,93 99,93 99,76 99,48 99,55 99,56 99,57 99,56 99,65 99,5 99,5 99,49 99,49 99,46 99,52 99,49 99,55 99,57 99,57 99,57 99,57 99,57 99,57 99,57 99,57 99,53 100,38 100,32 100,46 100,47 100,47 100,47 100,51 100,5 100,51 100,51 100,51 100,51 101,65 102,13 102,2 102,13 102,13 102,12 102,13 102,05 102 102,01 102,01 102,02 102,78 103,39 103,41 103,5 103,5 103,49 103,38 103,24 103,25 103,25 103,25 103,25 103,83 104,33 104,36 104,48 104,5 104,48 104,35 104,48 104,48 104,47 104,47 104,86 105,22 105,96 106,03 106,03
 
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.805432048964002
beta0.0400555709654088
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
1399.98100.056026080726-0.0760260807263364
1499.9899.9894142160589-0.00941421605888593
1599.9399.92739952754270.00260047245728856
1699.9399.9318135632775-0.00181356327745164
1799.9399.9430369798857-0.0130369798857259
1899.9399.9493926268917-0.0193926268916869
1999.9399.88070964614710.049290353852868
2099.9399.91194416389020.0180558361097809
2199.7699.7796609650187-0.0196609650187014
2299.4899.6093286667098-0.129328666709796
2399.5599.6864859490623-0.136485949062291
2499.5699.5627546164881-0.00275461648813291
2599.5799.53191623126530.0380837687347082
2699.5699.5628321115556-0.00283211155557694
2799.6599.50157946841230.148420531587661
2899.599.6202070215222-0.120207021522205
2999.599.527635224943-0.0276352249430403
3099.4999.514240465384-0.0242404653841106
3199.4999.44833684372220.0416631562778349
3299.4699.4603251872479-0.00032518724786712
3399.5299.29894917455070.221050825449339
3499.4999.30175014747720.188249852522759
3599.5599.6436567937717-0.0936567937717427
3699.5799.5922707859568-0.0222707859568203
3799.5799.56485132024440.00514867975563504
3899.5799.571411737407-0.00141173740699685
3999.5799.5508749192090.0191250807909569
4099.5799.5191055549240.0508944450759401
4199.5799.5939106459389-0.0239106459389262
4299.5799.5958534595258-0.0258534595258340
4399.5799.55306328199720.0169367180028104
4499.5399.5477633308832-0.0177633308831702
45100.3899.42549720439230.954502795607695
46100.32100.0453255296820.274674470317706
47100.46100.4397956896610.0202043103392526
48100.47100.534848558395-0.0648485583945302
49100.47100.517568201039-0.0475682010389562
50100.47100.517841675767-0.0478416757673159
51100.51100.4997046025180.0102953974815705
52100.5100.502260013732-0.00226001373219731
53100.51100.553802081625-0.0438020816253584
54100.51100.572847276984-0.062847276983831
55100.51100.540575244873-0.0305752448729635
56100.51100.520588403206-0.0105884032060573
57101.65100.6234835295541.02651647044583
58102.13101.1986231555510.931376844448621
59102.2102.1282178192490.0717821807507306
60102.13102.304674947031-0.174674947031377
61102.13102.254796868257-0.124796868256709
62102.12102.242856712216-0.122856712216446
63102.13102.223152374765-0.0931523747653245
64102.05102.183475917548-0.133475917548068
65102102.16141160718-0.161411607179957
66102.01102.118488968804-0.108488968803996
67102.01102.090370631631-0.0803706316307569
68102.02102.066965518238-0.0469655182383093
69102.78102.3770251890810.402974810919275
70103.39102.4384034072180.951596592782167
71103.41103.2285324197150.181467580284917
72103.5103.4609573719170.0390426280828251
73103.5103.615869397064-0.115869397063804
74103.49103.634643508598-0.144643508598023
75103.38103.625628357974-0.24562835797407
76103.24103.472105246967-0.232105246966967
77103.25103.379491254403-0.129491254403462
78103.25103.388246551634-0.138246551633856
79103.25103.355986363042-0.105986363042319
80103.25103.331805950095-0.0818059500950596
81103.83103.7181299332970.111870066703219
82104.33103.6511182826430.678881717356617
83104.36104.0640543908050.295945609194931
84104.48104.3583814125190.121618587480512
85104.5104.550002703813-0.0500027038132913
86104.48104.618845407868-0.138845407867848
87104.35104.597456454143-0.247456454143233
88104.48104.4473184586970.0326815413028640
89104.48104.599583821849-0.119583821848664
90104.47104.626603128107-0.156603128107491
91104.47104.596981309612-0.126981309611551
92104.86104.5708767641880.289123235811758
93105.22105.322398830352-0.102398830351973
94105.96105.2063069418810.753693058118785
95106.03105.6183963433670.411603656632536
96106.03105.9922531629900.0377468370102605


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
97106.101069445953105.578672561934106.623466329971
98106.213113045307105.531659391492106.894566699122
99106.306737881186105.487755376750107.125720385622
100106.443550588108105.498523081704107.388578094511
101106.571773618395105.508028046882107.635519189908
102106.724152181374105.546299324511107.902005038237
103106.867608062265105.579034116346108.156182008185
104107.071334462219105.673671470408108.468997454029
105107.556964544593106.048285030223109.065644058963
106107.729150492297106.114410522878109.343890461715
107107.475790585857105.761837740730109.189743430984
108107.444598443947102.684829795156112.204367092738
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/1mzkq1263923303.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/1mzkq1263923303.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/230591263923303.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/230591263923303.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/3p33a1263923303.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/19/t1263923353sboft419iinsbb9/3p33a1263923303.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