Home » date » 2009 » Jun » 07 »

Thomas Van den Bosch opgave 10 oef 2

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Sun, 07 Jun 2009 13:33:43 -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/07/t1244403265xhk1l9ag8xtuxuu.htm/, Retrieved Sun, 07 Jun 2009 21:34:29 +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/07/t1244403265xhk1l9ag8xtuxuu.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 «
36.80 35.40 33.00 28.73 26.70 26.46 24.60 28.00 31.60 33.50 34.50 35.00 34.76 33.50 32.74 34.40 31.93 29.24 25.75 26.03 26.08 23.80 20.61 19.70 18.18 19.60 20.60 20.03 23.00 23.60 22.56 22.55 23.75 24.92 24.50 30.58 28.07 27.70 27.00 25.23 26.86 25.60 24.55 23.96 23.50 23.64 21.55 21.05 21.89 21.98 21.45 22.15 22.58 23.80 23.30 22.38 23.00 21.96 22.40 20.80 20.40 16.00 12.78 9.75 7.50 11.24 12.24 12.75 12.52 14.49 14.21 14.32 22.15 22.58 23.80 23.30 22.38 23.00 21.96 22.40 20.80 20.40 16.00 12.78 9.75 7.50 11.24 12.24 12.75 12.52 14.49 14.21 14.32
 
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.777924358723283
beta0
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
1334.7633.4384214743591.32157852564102
1433.533.14713751517360.352862484826353
1532.7432.8801824178193-0.140182417819275
1634.434.9717590140859-0.571759014085856
1731.9332.9463516634618-1.01635166346177
1829.2430.5884181945122-1.34841819451218
1925.7522.54924541567513.20075458432493
2026.0328.5098182868696-2.47981828686955
2126.0830.1771684833925-4.09716848339253
2223.828.5709258987877-4.77092589878773
2320.6125.3118010088766-4.70180100887656
2419.721.7268667212880-2.02686672128803
2518.1819.946319372578-1.76631937257799
2619.617.03775618513872.56224381486130
2720.618.38003937919372.21996062080629
2820.0322.2117860859024-2.18178608590237
292318.83516626019124.16483373980877
3023.620.43405923567783.16594076432225
3122.5616.91697671707755.64302328292253
3222.5523.5159330362688-0.96593303626879
3323.7526.0017973634841-2.25179736348414
3424.9225.6814888138517-0.761488813851706
3524.525.5567536513359-1.05675365133595
3630.5825.40142823916755.1785717608325
3728.0729.2840282205289-1.21402822052886
3827.727.7663742190333-0.0663742190332997
392726.98777865492440.0122213450756092
4025.2328.1245504787021-2.89455047870205
4126.8625.60288353753581.25711646246424
4225.624.71796261659740.882037383402555
4324.5519.97427571382284.57572428617723
4423.9624.2752659326508-0.315265932650782
4523.526.9817409041293-3.4817409041293
4623.6426.0355905412344-2.39559054123443
4721.5524.5740767122251-3.02407671222508
4821.0524.2730366589892-3.22303665898924
4921.8920.20018005783031.68981994216971
5021.9821.19636627447770.78363372552229
5121.4521.09646675584790.353533244152104
5222.1521.85323020302870.296769796971251
5322.5822.7361531391231-0.15615313912307
5423.820.66851944265473.13148055734527
5523.318.4950070660634.80499293393699
5622.3821.88818116135050.491818838649493
572324.5193100761003-1.51931007610035
5821.9625.3409899950015-3.38098999500152
5922.422.9733384583778-0.57333845837784
6020.824.5346032318987-3.7346032318987
6120.421.1548123127678-0.754812312767822
621620.0480176650006-4.04801766500061
6312.7816.0939439966101-3.3139439966101
649.7513.9850817842050-4.23508178420502
657.511.2419838337016-3.74198383370162
6611.247.114948455089154.12505154491085
6712.246.086005486061576.15399451393843
6812.759.570749867239293.17925013276071
6912.5213.8458743046403-1.32587430464027
7014.4914.40459886016670.0854011398333014
7114.2115.3570484396707-1.14704843967073
7214.3215.7699703420760-1.44997034207604
7322.1514.82918997791517.3208100220849
7422.5819.27327796582663.3067220341734
7523.821.20365534214492.59634465785512
7623.323.4879883762498-0.187988376249788
7722.3824.0027280133935-1.62272801339346
782323.2713902864168-0.271390286416789
7921.9619.27292693605012.68707306394987
8022.419.40005040541712.99994959458285
8120.822.5352141881701-1.73521418817014
8220.423.0889131766513-2.68891317665128
831621.6094590398976-5.60945903989764
8412.7818.4836914620280-5.70369146202803
859.7516.1816144973090-6.43161449730903
867.59.03592529602405-1.53592529602405
8711.247.04133184208114.1986681579189
8812.249.953818813363582.28618118663642
8912.7512.07465449610440.675345503895638
9012.5213.4311433286635-0.911143328663542
9114.499.592003148892154.89799685110785
9214.2111.50854034375082.70145965624916
9314.3213.35993699903510.960063000964904


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
9415.79856445200379.879877731177621.7172511728298
9515.76229927840068.263609781649223.260988775152
9616.97933980135428.1799173295043525.7787622732041
9718.95264938472879.0214194756236428.8838792938338
9817.89748308568516.95084802385428.8441181475162
9918.37123685144426.49570272255930.2467709803293
10017.59276081790484.8558929723266330.3296286634830
10117.57739309987014.0338598021988831.1209263975414
10218.05619368952573.7514117668770332.3609756121744
10316.21592263009901.1884052861082131.2434399740897
10413.8343913593945-1.8826620919795529.5514448107686
10513.1975349650350-3.1800491322229929.5751190622929
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/1gume1244403221.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/1gume1244403221.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/2pkzt1244403221.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/2pkzt1244403221.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/3z8pt1244403221.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244403265xhk1l9ag8xtuxuu/3z8pt1244403221.ps (open in new window)


 
Parameters (Session):
 
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=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