Home » date » 2009 » Jun » 02 »

Martin Horemans - 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: Tue, 02 Jun 2009 12:29:46 -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/t12439675011xpk655z9xsc1ni.htm/, Retrieved Tue, 02 Jun 2009 20:31:44 +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/t12439675011xpk655z9xsc1ni.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 «
1746 1271 1363 1664 2179 2305 2098 2231 1407 1966 2293 2045 1532 1333 1583 1712 2641 2267 2126 2231 1517 2010 2628 2115 1829 1636 1787 2122 2620 2555 2337 2524 1801 2417 2389 2267 2135 1760 1905 2176 2344 2674 2766 2783 2000 2588 2736 2704 2466 1976 2171 2397 2942 2707 2861 2765 1814 2611 2606 2518 2267 1730 1901 2124 2448 2489 2521 2466 1827 2278 2373 2356 2075 1606 1699 2311 2093 2064 2180 2136
 
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.279673175984277
beta0.105814685840969
gamma0.78536497988161


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
1315321461.3245192307770.6754807692303
1413331292.1496039644840.8503960355224
1515831561.4256532501921.5743467498050
1617121703.115836340118.88416365989133
1726412632.144829378628.8551706213807
1822672257.344436259489.65556374052358
1921262204.84530050069-78.8453005006945
2022312333.67820292190-102.678202921904
2115171477.7237380947039.2762619052953
2220102046.21578582993-36.2157858299286
2326282350.43964656270277.560353437296
2421152179.21560048522-64.2156004852159
2518291703.57144991363125.428550086370
2616361540.2390955603295.7609044396831
2717871822.99452763994-35.9945276399433
2821221948.72871381541173.271286184586
2926202935.90432526461-315.904325264612
3025552473.3077825115681.6922174884371
3123372395.59809608675-58.59809608675
3225242521.919438847282.08056115272302
3318011783.9783523547917.0216476452104
3424172311.28922691044105.710773089564
3523892844.66568156603-455.665681566025
3622672265.280200637061.71979936293701
3721351907.56458843248227.435411567518
3817601751.198784432538.80121556746508
3919051927.74539989475-22.7453998947549
4021762168.610931551927.38906844808389
4123442820.78870880933-476.788708809333
4226742521.49522099752152.504779002478
4327662369.69054082385396.309459176148
4427832656.49233463977126.507665360232
4520001964.4127851035435.5872148964602
4625882550.2486859115837.7513140884166
4727362748.18552767517-12.1855276751658
4827042565.85397137374138.14602862626
4924662392.2947176889473.7052823110639
5019762083.00957052961-107.009570529613
5121712219.65370142218-48.653701422184
5223972479.88753334324-82.8875333432361
5329422839.80347393924102.196526060758
5427073082.46931401563-375.469314015630
5528612929.33399331702-68.3339933170246
5627652928.20941041026-163.209410410261
5718142089.74860599598-275.748605995978
5826112566.6032844125244.3967155874766
5926062715.21186676898-109.211866768981
6025182564.98222464364-46.9822246436352
6122672271.90567319405-4.90567319405318
6217301804.78835867401-74.7883586740134
6319011950.79760594561-49.7976059456057
6421242158.65157818861-34.6515781886083
6524482605.49775285329-157.497752853291
6624892466.3582138709222.6417861290806
6725212571.14683632024-50.1468363202389
6824662494.80458474976-28.8045847497588
6918271607.61384605312219.386153946877
7022782396.05591370195-118.055913701951
7123732399.52298152739-26.5229815273888
7223562297.2622709075858.7377290924205
7320752050.3234539717124.6765460282932
7416061545.5881149689960.4118850310088
7516991741.19066886177-42.1906688617651
7623111957.60928603307353.390713966933
7720932452.83633609464-359.836336094642
7820642362.38098007643-298.380980076427
7921802330.07442315643-150.074423156432
8021362228.76584063650-92.7658406365035


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
811453.107353711711135.996583624811770.2181237986
821971.817211768821639.887521833332303.74690170431
832046.09876187041697.208864613942394.98865912686
841986.289818506761618.35517827752354.22445873603
851688.716660938991299.732508029942077.70081384805
861181.62796535169769.6830533264271593.57287737696
871284.8347077243848.1175768458651721.55183860273
881720.633614765361257.433299861972183.83392966875
891686.874864839451195.577822867992178.17190681090
901715.805923979741194.890630954802236.72121700469
911843.661928500331291.692233831002395.63162316966
921814.000448371011229.618447995552398.38244874647
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t12439675011xpk655z9xsc1ni/163y81243967384.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t12439675011xpk655z9xsc1ni/163y81243967384.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t12439675011xpk655z9xsc1ni/2kan31243967384.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t12439675011xpk655z9xsc1ni/2kan31243967384.ps (open in new window)


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