Home » date » 2009 » Dec » 04 »

Classical decomposition

*The author of this computation has been verified*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 04 Dec 2009 05:18:20 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i.htm/, Retrieved Fri, 04 Dec 2009 13:19:15 +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/2009/Dec/04/t1259929150djjpc2d9710nw1i.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 «
19 18 19 19 22 23 20 14 14 14 15 11 17 16 20 24 23 20 21 19 23 23 23 23 27 26 17 24 26 24 27 27 26 24 23 23 24 17 21 19 22 22 18 16 14 12 14 16 8 3 0 5 1 1 3 6 7 8 14 14 13
 
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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
119NANA1.10832915792510NA
218NANA0.850215644153432NA
319NANA0.748795488731985NA
419NANA1.07113401149497NA
522NANA0.949344012552167NA
623NANA0.887929621038847NA
72016.676417821354117.250.9667488592089341.19929832738959
81418.863932971628617.08333333333331.104230222729480.742157005172572
91417.714270785766917.04166666666671.039468212367740.790323246681355
101417.418590333253117.29166666666671.007340163850780.80373897842199
111518.805782391285717.54166666666671.072063604253810.797627011091588
121120.852250821219317.45833333333331.194401001692750.527520990146847
131719.257219118948617.3751.108329157925100.882785821514198
141614.985050728204217.6250.8502156441534321.06773078651549
152013.634317857328218.20833333333330.7487954887319851.46688673458279
162420.306915634592018.95833333333331.071134011494971.18186338249798
172318.670432246859319.66666666666670.9493440125521671.23189435016262
182018.202557231296420.50.8879296210388471.09874671706090
192120.70453806805821.41666666666670.9667488592089341.01427039477871
201924.569122455730922.251.104230222729480.773328393565321
212323.431345953789522.54166666666671.039468212367740.98159107229093
222322.581208672988422.41666666666671.007340163850781.01854601022808
232324.166100412554722.54166666666671.072063604253810.951746438496593
242327.272156205317822.83333333333331.194401001692750.843350992376437
252725.768652921758623.251.108329157925101.04778468948222
262620.263472852323523.83333333333330.8502156441534321.28309693947742
271718.189490413781124.29166666666670.7487954887319850.934605621888124
282426.198152697814424.45833333333331.071134011494970.916095126127052
292623.258928307528124.50.9493440125521671.11785030059122
302421.754275715451824.50.8879296210388471.10323139753870
312723.564503443217824.3750.9667488592089341.14579117124452
322726.363496567666323.8751.104230222729481.02414336166297
332624.600747692703223.66666666666671.039468212367741.05687844632917
342423.798411370974723.6251.007340163850781.00847067587340
352324.925478798901223.251.072063604253810.922750579259241
362327.4712230389333231.194401001692750.837239753301245
372424.98358643489522.54166666666671.108329157925100.960630694978155
381718.456764608497421.70833333333330.8502156441534320.921071507417571
392115.537506391188720.750.7487954887319851.3515682292436
401921.154896727025619.751.071134011494970.898137213580785
412217.918868236922118.8750.9493440125521671.2277561121114
422216.167718516415718.20833333333330.8879296210388471.36073620886352
431816.676417821354117.250.9667488592089341.07936849465063
441617.6676835636716161.104230222729480.905608250359389
451415.115600254847614.54166666666671.039468212367740.926195438087892
461213.179367143714413.08333333333331.007340163850780.910514129331554
471412.462739399450611.6251.072063604253811.12334853127212
481611.79470989171599.8751.194401001692751.35654035977923
4989.282256697622738.3751.108329157925100.861859379739937
5036.234914723791837.333333333333330.8502156441534320.481161352304032
5104.96077011284946.6250.7487954887319850
5256.605326404218956.166666666666671.071134011494970.756964863508698
5315.69606407531360.9493440125521670.175559822849263
5415.253583591146515.916666666666670.8879296210388470.190346262251395
5535.840774357720646.041666666666670.9667488592089340.513630525040647
566NANA1.10423022272948NA
577NANA1.03946821236774NA
588NANA1.00734016385078NA
5914NANA1.07206360425381NA
6014NANA1.19440100169275NA
6113NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/17qx21259929098.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/17qx21259929098.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/2zrly1259929098.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/2zrly1259929098.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/33zz61259929098.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/33zz61259929098.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/403e31259929098.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929150djjpc2d9710nw1i/403e31259929098.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = multiplicative ; par2 = 12 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
R code (references can be found in the software module):
par2 <- as.numeric(par2)
x <- ts(x,freq=par2)
m <- decompose(x,type=par1)
m$figure
bitmap(file='test1.png')
plot(m)
dev.off()
mylagmax <- length(x)/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(as.numeric(m$trend),na.action=na.pass,lag.max = mylagmax,main='Trend')
acf(as.numeric(m$seasonal),na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(as.numeric(m$random),na.action=na.pass,lag.max = mylagmax,main='Random')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
spectrum(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
spectrum(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
cpgram(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
cpgram(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Classical Decomposition by Moving Averages',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observations',header=TRUE)
a<-table.element(a,'Fit',header=TRUE)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Random',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(m$trend)) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
if (par1 == 'additive') a<-table.element(a,m$trend[i]+m$seasonal[i]) else a<-table.element(a,m$trend[i]*m$seasonal[i])
a<-table.element(a,m$trend[i])
a<-table.element(a,m$seasonal[i])
a<-table.element(a,m$random[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.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