Home » date » 2011 » May » 18 »

*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 12:40:59 +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/t1305722278m5c0hvaoa58n7gh.htm/, Retrieved Wed, 18 May 2011 14:38:01 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
814 1150 1225 1691 1759 1754 2100 2062 2012 1897 1964 2186 966 1549 1538 1612 2078 2137 2907 2249 1883 1739 1828 1868 1138 1430 1809 1763 2200 2067 2503 2141 2103 1972 2181 2344 970 1199 1718 1683 2025 2051 2439 2353 2230 1852 2147 2286 1007 1665 1642 1518 1831 2207 2822 2393 2306 1785 2047 2171 1212 1335 2011 1860 1954 2152 2835 2224 2182 1992 2389 2724 891 1247 2017 2257 2255 2255 3057 3330 1896 2096 2374 2535 1041 1728 2201 2455 2204 2660 3670 2665 2639 2226 2586 2684 1185 1749 2459 2618 2585 3310 3923
 
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' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.171837101246772
beta0
gamma0.386851263600274


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13966890.37487102069575.6251289793047
1415491431.26540160807117.734598391932
1515381453.250790922684.7492090774037
1616121562.718190933649.2818090664045
1720782057.4693081741720.530691825832
1821372160.60990815768-23.6099081576813
1929072327.02923601584579.970763984157
2022492371.90374660748-122.903746607481
2118832275.09132018145-392.09132018145
2217392088.5556874905-349.555687490495
2318282107.37328273892-279.373282738923
2418682276.15735192144-408.157351921438
251138983.685964199098154.314035800902
2614301597.94935199721-167.949351997213
2718091558.76134094957250.23865905043
2817631690.1238408673472.8761591326563
2922002213.09042200071-13.0904220007133
3020672300.85738822245-233.857388222445
3125032634.22289608979-131.222896089791
3221412331.4449766286-190.444976628596
3321032133.963224215-30.9632242150019
3419722016.97246438246-44.9724643824586
3521812112.4553236313168.5446763686859
3623442307.5095100798236.4904899201788
379701149.31718857444-179.317188574435
3811991628.10390677362-429.103906773623
3917181678.6160863352639.3839136647357
4016831716.7851533595-33.785153359499
4120252189.84203542125-164.842035421247
4220512179.49365273091-128.493652730908
4324392558.50852518634-119.508525186343
4423532241.83984809527111.160151904734
4522302145.8827304727384.1172695272658
4618522041.50208807352-189.502088073515
4721472149.25232240628-2.25232240627884
4822862322.03079251129-36.0307925112884
4910071085.80783155629-78.8078315562923
5016651499.65495782406165.345042175942
5116421822.70552670598-180.705526705982
5215181799.1924568875-281.192456887499
5318312199.51454663209-368.514546632086
5422072165.5291468775141.4708531224892
5528222586.49209911449235.507900885514
5623932392.085853964470.914146035534031
5723062262.4011392128643.5988607871395
5817852053.94526409419-268.945264094192
5920472213.59360536566-166.593605365655
6021712349.72746842407-178.72746842407
6112121066.95664625435145.043353745648
6213351617.56743478251-282.567434782512
6320111750.50001777202260.499982227984
6418601766.6588291947893.341170805217
6519542229.20033358206-275.20033358206
6621522354.07089111243-202.070891112428
6728352821.7843869921413.2156130078597
6822242499.17192715494-275.171927154935
6921822332.32640922816-150.326409228161
7019921985.121302973156.87869702685134
7123892231.67363751923157.326362480774
7227242427.23706486073296.762935139272
738911217.94263141972-326.942631419722
7412471555.33432394767-308.33432394767
7520171861.20428215139155.795717848615
7622571805.07154481788451.928455182124
7722552221.230976563133.7690234368979
7822552432.88275703902-177.882757039023
7930573009.6714612563647.3285387436449
8033302569.47036879694760.529631203062
8118962606.04087332991-710.040873329906
8220962184.33339151501-88.333391515012
8323742487.07905491054-113.079054910535
8425352692.03977051495-157.039770514949
8510411147.34045999992-106.340459999922
8617281551.32916861704176.670831382963
8722012150.8776534646150.1223465353878
8824552164.4052766606290.594723339399
8922042436.13220717465-232.132207174655
9026602542.01819880033117.981801199671
9136703302.50843006674367.491569933263
9226653106.32350670552-441.323506705517
9326392436.59954952698202.400450473016
9422262359.57132754962-133.571327549615
9525862673.00752314577-87.0075231457672
9626842885.60415105108-201.604151051084
9711851212.50477919223-27.5047791922266
9817491771.11376805478-22.113768054784
9924592336.29249633475122.707503665255
10026182442.56242295145175.437577048554
10125852528.4235315344656.5764684655405
10233102818.10536968948491.894630310517
10339233813.00610020984109.993899790165


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
1043255.692451156113030.533199346783480.85170296544
1052815.648745149312580.569785012593050.72770528603
1062569.848938695392325.842555833692813.8553215571
1072961.113770957882695.781197341073226.44634457468
1083172.691748711542889.747385352433455.63611207065
1091369.414318431861130.166757588071608.66187927566
1102013.101606751491734.058619857032292.14459364596
1112714.192816365162381.616923336643046.76870939369
1122826.833741811222478.191612775933175.47587084651
1132844.525221590722487.039944400193202.01049878125
1143303.992547690612901.799490199663706.18560518156
1154152.704628369213724.447971624744580.96128511368
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/18/t1305722278m5c0hvaoa58n7gh/1pz0w1305722456.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t1305722278m5c0hvaoa58n7gh/1pz0w1305722456.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/18/t1305722278m5c0hvaoa58n7gh/2a1ln1305722456.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t1305722278m5c0hvaoa58n7gh/2a1ln1305722456.ps (open in new window)


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