Home » date » 2010 » Jan » 18 »

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: Mon, 18 Jan 2010 08:56:11 -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/18/t12638302246qiwwyg1q05azt1.htm/, Retrieved Mon, 18 Jan 2010 16:57:08 +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/18/t12638302246qiwwyg1q05azt1.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 «
102,5 77,7 82,8 77,3 103,1 99,7 99,5 107,2 96,7 97,1 105,2 151,2 102,7 75,4 87,2 83,7 105,8 111,5 99,7 111,2 101,5 110,9 116,3 164,9 118,1 83,7 84 107,2 113,7 120,7 111,2 112,4 112,5 130,4 130,7 174,3 132,2 91,8 104,2 104,8 131,4 141,2 132,7 135,7 136,9 151,2 144 201,5 149,6 108,7 122,8 126,7 139,9 162,5 142,7 151,6 148,1 159 157,8 226,7 153,7 122,3 117,6 166 154,5 183,9 164,4 173,3 160,2 166,4 170,3 238,4 166,8 122,5 141,8 140,5 173,8 188,8 168 187,4 177,7 183,8 196,1 264,6 193,7 141,3 170,1 163,7 190,1 230,7 195,9 210,3 204,7 210,3 221,2 288,2 203,2 162,4 149,2 195,3 213,7 227,9 212,1 226,8 212,6 220,9 228,1 311,6
 
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.152389418657338
beta0.0403497841851909
gamma0.289315718348342


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13102.799.85415776648042.84584223351962
1475.473.86407647569961.53592352430037
1587.285.81492771850641.38507228149356
1683.782.36839556526891.33160443473115
17105.8103.8646666592061.93533334079383
18111.5109.2594124506232.24058754937664
1999.7103.552937819575-3.85293781957476
20111.2111.592282860904-0.392282860904231
21101.5101.0236809424440.476319057555585
22110.9101.5660285983229.33397140167772
23116.3111.7685035443994.5314964556013
24164.9161.5795830816823.32041691831793
25118.1110.9488295039867.15117049601382
2683.782.45722314037251.24277685962748
278495.7097150921302-11.7097150921302
28107.289.961800944224317.2381990557757
29113.7116.677877146881-2.97787714688113
30120.7122.089478988153-1.38947898815346
31111.2113.617386421764-2.41738642176409
32112.4123.875711719721-11.4757117197207
33112.5110.8873899599131.61261004008730
34130.4114.05002803767916.3499719623206
35130.7125.0369648498725.66303515012832
36174.3180.148818447016-5.84881844701641
37132.2124.0534716617328.14652833826754
3891.891.16561781126430.634382188735714
39104.2102.1178049529492.08219504705104
40104.8105.946193936461-1.14619393646073
41131.4126.6780957362894.72190426371127
42141.2134.3487235300086.85127646999155
43132.7125.9960731957316.70392680426896
44135.7136.595426964986-0.8954269649862
45136.9127.4670688204989.4329311795017
46151.2136.59821418901214.6017858109880
47144145.803742351963-1.80374235196251
48201.5204.568736053253-3.06873605325254
49149.6144.8459132696674.75408673033252
50108.7104.5508479468364.14915205316417
51122.8118.2295141879504.57048581205039
52126.7122.2299405179044.47005948209616
53139.9149.170215243516-9.27021524351608
54162.5156.4931271346526.00687286534759
55142.7146.699640439811-3.99964043981112
56151.6154.930791018806-3.33079101880574
57148.1147.1384134805550.961586519445149
58159157.2950524533721.70494754662803
59157.8160.765946370615-2.9659463706154
60226.7225.1159375387791.58406246122121
61153.7161.762691979094-8.06269197909418
62122.3115.4083064882516.89169351174898
63117.6130.795358567693-13.1953585676933
64166132.12724126968133.8727587303188
65154.5162.577769569462-8.07776956946228
66183.9175.160680901118.73931909889018
67164.4161.8576686840002.54233131599972
68173.3172.3378599158490.9621400841514
69160.2165.534649711094-5.33464971109444
70166.4176.118688701466-9.71868870146588
71170.3176.877063656989-6.57706365698888
72238.4248.438145850133-10.0381458501329
73166.8174.649207746374-7.84920774637393
74122.5128.014099723703-5.51409972370283
75141.8137.1046771186954.69532288130526
76140.5153.763910712417-13.2639107124170
77173.8167.0174645087366.78253549126444
78188.8186.6558867666212.1441132333795
79168169.776545813552-1.77654581355222
80187.4179.2750991790898.1249008209109
81177.7171.3525719276436.34742807235699
82183.8182.9560115532450.84398844675485
83196.1186.1022521741739.99774782582668
84264.6264.70569713596-0.105697135960042
85193.7186.9693504150606.7306495849397
86141.3138.8371268420742.46287315792557
87170.1153.03942281651317.0605771834873
88163.7168.661514288136-4.96151428813573
89190.1190.946882434901-0.846882434900749
90230.7210.64899439838520.0510056016149
91195.9193.2531897909382.64681020906161
92210.3207.9084504928582.39154950714226
93204.7197.5543789522177.14562104778307
94210.3209.5043064146330.79569358536736
95221.2215.8761728773745.32382712262589
96288.2302.03938884432-13.8393888443202
97203.2213.908324541505-10.7083245415054
98162.4156.1294982000616.27050179993947
99149.2176.639134446847-27.439134446847
100195.3180.50630074410814.793699255892
101213.7209.0547078561304.6452921438696
102227.9237.096744304260-9.19674430425965
103212.1208.8575315796313.24246842036882
104226.8224.4435079901242.35649200987592
105212.6214.325818835862-1.72581883586176
106220.9223.761351406124-2.86135140612356
107228.1230.891271727254-2.79127172725376
108311.6315.294264877466-3.69426487746625


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
109223.972630086684217.537735902683230.407524270686
110168.283969247903161.569803264235174.998135231571
111179.897323263878172.595500523373187.199146004382
112199.781434347138191.714430661169207.848438033106
113225.147416182435216.111379710796234.183452654075
114250.501208821895240.383009309149260.619408334642
115224.851043074167214.913794158129234.788291990204
116240.616902366314229.736149297275251.497655435353
117228.211020791761217.233978052832239.188063530690
118238.125826675523226.317468962718249.934184388328
119246.102538660923233.500227836307258.70484948554
120336.558436973491319.414273267573353.702600679409
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/18/t12638302246qiwwyg1q05azt1/1i6wg1263830168.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/18/t12638302246qiwwyg1q05azt1/1i6wg1263830168.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/18/t12638302246qiwwyg1q05azt1/2jn7k1263830168.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/18/t12638302246qiwwyg1q05azt1/2jn7k1263830168.ps (open in new window)


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