Home » date » 2009 » Jun » 03 »

Opgave 10, oefening 2, stap 1, Sara Vandenberghe

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Wed, 03 Jun 2009 12:02:06 -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/03/t1244052174qjzs0atfyk6be3g.htm/, Retrieved Wed, 03 Jun 2009 20:02:58 +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/03/t1244052174qjzs0atfyk6be3g.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 «
1.54 1.55 1.53 1.55 1.55 1.53 1.54 1.54 1.54 1.53 1.53 1.53 1.54 1.53 1.53 1.54 1.55 1.53 1.53 1.53 1.53 1.52 1.54 1.53 1.52 1.54 1.53 1.54 1.54 1.53 1.54 1.54 1.52 1.52 1.57 1.6 1.59 1.6 1.6 1.62 1.61 1.61 1.62 1.61 1.62 1.61 1.62 1.61 1.61 1.58 1.57 1.57 1.66 1.66 1.67 1.68 1.66 1.66 1.64 1.61 1.58 1.57 1.54 1.61 1.65 1.6 1.57 1.56 1.55 1.54 1.51 1.5 1.5 1.49 1.47 1.47 1.49 1.49 1.49 1.51 1.49 1.48 1.46 1.46 1.45 1.45 1.44 1.47 1.47 1.45 1.43 1.44 1.38 1.4 1.37 1.41
 
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'Gwilym Jenkins' @ 72.249.127.135


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.871955057656946
beta0
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
131.541.54198183760684-0.00198183760683746
141.531.53060050087884-0.000600500878837451
151.531.53042362769714-0.000423627697144102
161.541.54040097998079-0.000400979980792471
171.551.549564746721920.000435253278075587
181.531.529041004615840.000958995384159333
191.531.53439060875473-0.00439060875473141
201.531.53090893184159-0.000908931841587135
211.531.53046312072199-0.000463120721986066
221.521.519989370196211.06298037854113e-05
231.541.519928708837460.0200712911625434
241.531.53694337594374-0.00694337594374494
251.521.54056536982035-0.0205653698203523
261.541.513156901371340.0268430986286596
271.531.53693226129687-0.00693226129687274
281.541.54123727752034-0.0012372775203362
291.541.54977890583157-0.00977890583157404
301.531.520415938557890.00958406144210544
311.541.532601222915110.00739877708488579
321.541.539845171731090.000154828268906115
331.521.54038399547908-0.0203839954790761
341.521.512600798814670.00739920118533322
351.571.521551305867950.0484486941320454
361.61.559850701524630.0401492984753724
371.591.60279116361905-0.0127911636190485
381.61.588231868195660.0117681318043423
391.61.594537770540440.00546222945956454
401.621.610379439535370.009620560464632
411.611.62729490228819-0.0172949022881905
421.611.593857653918980.0161423460810186
431.621.611481653127130.008518346872868
441.611.61877426547366-0.00877426547366467
451.621.608897428269910.0111025717300854
461.611.61212660094679-0.00212660094678907
471.621.618027216610310.00197278338969276
481.611.61473901119763-0.0047390111976322
491.611.61176012622651-0.00176012622651056
501.581.60996409321522-0.0299640932152201
511.571.57907393198475-0.0090739319847546
521.571.58277317474318-0.0127731747431823
531.661.57671591794540.083284082054601
541.661.635260494207430.0247395057925683
551.671.659404615768520.0105953842314785
561.681.666294079793960.0137059202060354
571.661.67856408266441-0.0185640826644127
581.661.654231337345590.00576866265441289
591.641.66754117346871-0.027541173468715
601.611.63765871275093-0.02765871275093
611.581.61507630924480-0.0350763092447965
621.571.58061868662197-0.0106186866219724
631.541.56927173000321-0.0292717300032113
641.611.554885731300200.0551142686998036
651.651.620322920072230.0296770799277715
661.61.62462826281198-0.0246282628119749
671.571.60391482562331-0.0339148256233128
681.561.57239167544802-0.0123916754480164
691.551.55777373713827-0.00777373713827134
701.541.54596537314623-0.00596537314622814
711.511.54477850136042-0.0347785013604167
721.51.50857036567293-0.00857036567292657
731.51.50168235722839-0.00168235722838839
741.491.49947443484001-0.00947443484001242
751.471.48673678648549-0.0167367864854910
761.471.49408589551868-0.0240858955186849
771.491.487206997163460.00279300283653927
781.491.461117108433040.0288828915669626
791.491.485873895546410.00412610445359118
801.511.490276657272880.0197233427271204
811.491.50425287513230-0.0142528751323048
821.481.48702654586020-0.00702654586020324
831.461.48122500381848-0.0212250038184849
841.461.46019072808465-0.000190728084646707
851.451.46149136166068-0.0114913616606809
861.451.449732692118480.000267307881524737
871.441.44455949820267-0.00455949820267088
881.471.461585639100190.00841436089981151
891.471.48648721069436-0.0164872106943592
901.451.446926520561190.0030734794388132
911.431.44600867885574-0.0160086788557352
921.441.434851961916260.00514803808374298
931.381.43176868631815-0.0517686863181535
941.41.382755550655450.0172444493445538
951.371.39629918490625-0.0262991849062546
961.411.373533783933040.0364662160669642


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
971.405350636385631.364242868337191.44645840443407
981.405117555926381.350577204064831.45965790778794
991.399093233444581.333828760961911.46435770592725
1001.421756288901041.347296549741551.49621602806053
1011.436132395652641.353494304296671.51877048700862
1021.413452459711361.323375517433021.50352940198971
1031.407411308206031.310464637724391.50435797868767
1041.412922450361901.309561634262501.51628326646130
1051.398062418225271.288662876672331.50746195977820
1061.403026033402781.287904093359831.51814797344572
1071.395957740694041.275384682067711.51653079932037
1081.404160839160841.278372668597121.52994900972456
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244052174qjzs0atfyk6be3g/19mig1244052124.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244052174qjzs0atfyk6be3g/19mig1244052124.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244052174qjzs0atfyk6be3g/2bamt1244052124.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244052174qjzs0atfyk6be3g/2bamt1244052124.ps (open in new window)


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