Home » date » 2010 » Jan » 15 »

opgave 10 oefening 2 (Steffi Poppe MAR202b)

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Fri, 15 Jan 2010 08:53:52 -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/15/t12635711404byi4k2qu9kymqs.htm/, Retrieved Fri, 15 Jan 2010 16:59:05 +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/15/t12635711404byi4k2qu9kymqs.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 «
1,2 1,21 1,21 1,21 1,21 1,21 1,21 1,2 1,21 1,22 1,22 1,23 1,22 1,23 1,23 1,23 1,23 1,23 1,22 1,22 1,23 1,24 1,24 1,25 1,25 1,25 1,26 1,26 1,26 1,26 1,27 1,27 1,29 1,31 1,32 1,32 1,33 1,33 1,32 1,32 1,31 1,3 1,31 1,29 1,3 1,3 1,32 1,31 1,35 1,35 1,36 1,37 1,37 1,37 1,32 1,32 1,31 1,31 1,34 1,31 1,27 1,28 1,27 1,26 1,27 1,27 1,28 1,27 1,26 1,3 1,31 1,28 1,29 1,31 1,29 1,29 1,32 1,3 1,29 1,31 1,29 1,33 1,35 1,32 1,33
 
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.808659086679283
betaFALSE
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
21.211.20.01
31.211.208086590866790.00191340913320714
41.211.209633886548900.000366113451103933
51.211.209929947517897.00524821131143e-05
61.211.209986596094091.34039059078717e-05
71.211.209997435284402.56471559856308e-06
81.21.20999950926497-0.00999950926497495
91.211.201913315235520.00808668476448071
101.221.208452686351430.0115473136485724
111.221.217790526460080.00220947353991874
121.231.219577237314910.0104227626850861
131.221.22800569906851-0.00800569906851045
141.231.221531817771540.00846818222846046
151.231.228379690278240.00162030972175997
161.231.229689968457980.000310031542023914
171.231.229940678281595.93217184090555e-05
181.231.229988649328221.13506717802636e-05
191.221.22999782815209-0.00999782815209471
201.221.22191299356985-0.00191299356984542
211.231.220366033936830.00963396606316924
221.241.228156628134570.0118433718654276
231.241.237733878410470.00226612158952788
241.251.239566398225360.0104336017746360
251.251.248003625107220.00199637489278359
261.251.249618011804680.000381988195315763
271.261.249926910029830.0100730899701695
281.261.258072605765150.00192739423485389
291.261.259631210626770.000368789373226042
301.261.259929435504507.05644954959173e-05
311.271.259986498124980.0100135018750160
321.271.268084007405700.00191599259430419
331.291.269633392227090.0203666077729099
341.311.286103034667490.0238969653325136
351.321.305427532827680.0145724671723166
361.321.317211690821910.00278830917808714
371.331.319466482375240.0105335176247556
381.331.32798450711720.00201549288280067
391.321.32961435375101-0.0096143537510136
401.321.32183961922771-0.00183961922770748
411.311.32035199442319-0.0103519944231918
421.31.31198076006762-0.0119807600676245
431.311.302292409573620.00770759042638436
441.291.30852522260831-0.0185252226083135
451.31.293544633013340.00645536698665583
461.31.298764824184950.00123517581504728
471.321.299763660331440.020236339668563
481.311.31612796028555-0.00612796028554885
491.351.311172529517830.0388274704821701
501.351.342570716336010.00742928366399154
511.361.348578474078410.0114215259215869
521.371.357814594798650.0121854052013526
531.371.367668433439590.00233156656040978
541.371.369553875924860.000446124075136778
551.321.36991463821201-0.049914638212009
561.321.32955071246356-0.00955071246355899
571.311.32182744204564-0.0118274420456408
581.311.31226307356326-0.00226307356326072
591.341.310433018562510.0295669814374937
601.311.33434262676761-0.0243426267676132
611.271.31465774043834-0.0446577404383404
621.281.278544852842310.00145514715768846
631.271.27972157081383-0.00972157081383207
641.261.27186013423843-0.0118601342384308
651.271.262269328917290.0077306710827123
661.271.268520806334450.00147919366554827
671.281.269716969733060.0102830302669441
681.271.27803243559702-0.0080324355970185
691.261.27153693356332-0.0115369335633235
701.31.262207487404930.0377925125950733
711.311.292768746123370.0172312538766262
721.281.30670295614559-0.0267029561455852
731.291.285109368017260.00489063198274065
741.311.289064222009710.0209357779902932
751.291.30599412911826-0.0159941291182575
761.291.29306033127326-0.00306033127325667
771.321.290585566580890.0294144334191113
781.31.31437181544478-0.0143718154447758
791.291.30274991629328-0.0127499162932803
801.311.292439580628320.0175604193716812
811.291.30663997331913-0.0166399733191276
821.331.293183907692510.0368160923074858
831.351.322955575272990.0270444247270141
841.321.3448252950725-0.0248252950724999
851.331.324750094632630.00524990536737158


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
861.328995478312161.298623670959811.35936728566451
871.328995478312161.289935757418081.36805519920624
881.328995478312161.282855724186271.37513523243805
891.328995478312161.276726060625791.38126489599853
901.328995478312161.271243360257961.38674759636636
911.328995478312161.266237831334111.39175312529021
921.328995478312161.261603065024791.39638789159953
931.328995478312161.257267154177481.40072380244684
941.328995478312161.253178807337731.40481214928659
951.328995478312161.249299915624401.40869104099992
961.328995478312161.245601246937361.41238970968696
971.328995478312161.242059795528461.41593116109586
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/1mln01263570829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/1mln01263570829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/2yw0t1263570829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/2yw0t1263570829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/3f0uc1263570829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t12635711404byi4k2qu9kymqs/3f0uc1263570829.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Single ; par3 = multiplicative ;
 
Parameters (R input):
par1 = 12 ; par2 = Single ; 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