Home » date » 2010 » Dec » 18 »

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: Sat, 18 Dec 2010 16:25:39 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd.htm/, Retrieved Sat, 18 Dec 2010 17:26:00 +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/Dec/18/t1292689555jfdupsh6mtppgcd.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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
27951 29781 32914 33488 35652 36488 35387 35676 34844 32447 31068 29010 29812 30951 32974 32936 34012 32946 31948 30599 27691 25073 23406 22248 22896 25317 26558 26471 27543 26198 24725 25005 23462 20780 19815 19761 21454 23899 24939 23580 24562 24696 23785 23812 21917 19713 19282 18788 21453 24482 27474 27264 27349 30632 29429 30084 26290 24379 23335 21346 21106 24514 28353 30805 31348 34556 33855 34787 32529 29998 29257 28155 30466 35704 39327 39351 42234 43630 43722 43121 37985 37135 34646 33026 35087 38846 42013 43908 42868 44423 44167 43636 44382 42142 43452 36912 42413 45344 44873 47510 49554 47369 45998 48140 48441 44928 40454 38661 37246 36843 36424 37594 38144 38737 34560 36080 33508 35462 33374 32110 35533 35532 37903 36763 40399 44164 44496 43110 43880 43930 44327
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
127951NANA-3398.83757716049NA
229781NANA-733.879243827162NA
332914NANA1163.21334876543NA
433488NANA1875.88464506173NA
535652NANA2761.80594135803NA
636488NANA3356.00038580247NA
73538735062.870756172832969.70833333332093.16242283951324.129243827163
83567635483.1346450617330962387.13464506173192.865354938273
93484433372.690200617333147.25225.4402006172841471.30979938272
103244731467.764274691433126.75-1658.98572530864979.235725308637
113106829930.366126543233035.4166666667-3105.050540123461137.63387345678
122901027853.611496913632819.5-4965.888503086421156.38850308642
132981229129.787422839532528.625-3398.83757716049682.212577160491
143095131439.912422839532173.7916666667-733.879243827162-488.912422839505
153297432827.421682098831664.20833333331163.21334876543146.578317901236
163293632934.801311728431058.91666666671875.884645061731.19868827160826
173401233194.222608024730432.41666666672761.80594135803817.777391975309
183294633187.417052469129831.41666666673356.00038580247-241.417052469133
193194831354.662422839529261.52093.16242283951593.337577160491
203059931125.717978395128738.58333333332387.13464506173-526.71797839506
212769128461.940200617328236.5225.440200617284-770.940200617286
222507326040.805941358027699.7916666667-1658.98572530864-967.805941358023
232340624055.824459876527160.875-3105.05054012346-649.824459876541
242224821644.278163580226610.1666666667-4965.88850308642603.721836419754
252289622629.204089506226028.0416666667-3398.83757716049266.795910493827
262531724760.120756172825494-733.879243827162556.879243827167
272655826247.921682098825084.70833333331163.21334876543310.078317901232
282647126605.509645061724729.6251875.88464506173-134.509645061727
292754327162.930941358024401.1252761.80594135803380.069058641973
302619827503.875385802524147.8753356.00038580247-1305.87538580247
312472526077.329089506223984.16666666672093.16242283951-1352.32908950617
322500526252.1346450617238652387.13464506173-1247.13464506173
332346223963.898533950623738.4583333333225.440200617284-501.898533950618
342078021891.55594135823550.5416666667-1658.98572530864-1111.55594135802
351981520200.824459876523305.875-3105.05054012346-385.824459876541
361976118153.194830246923119.0833333333-4965.888503086421607.80516975309
372145419618.495756172823017.3333333333-3398.837577160491835.50424382716
382389922194.579089506222928.4583333333-733.8792438271621704.42091049383
392493923977.588348765422814.3751163.21334876543961.411651234568
402358024581.426311728422705.54166666671875.88464506173-1001.42631172840
412456225400.680941358022638.8752761.80594135803-838.680941358027
422469625932.125385802522576.1253356.00038580247-1236.12538580247
432378524628.704089506222535.54166666672093.16242283951-843.704089506176
442381224946.926311728422559.79166666672387.13464506173-1134.92631172840
452191722915.148533950622689.7083333333225.440200617284-998.148533950618
461971321289.847608024722948.8333333333-1658.98572530864-1576.84760802469
471928220113.407793209923218.4583333333-3105.05054012346-831.407793209873
481878818616.028163580223581.9166666667-4965.88850308642171.971836419754
492145320665.579089506224064.4166666667-3398.83757716049787.420910493831
502448223827.037422839524560.9166666667-733.879243827162654.962577160495
512747426167.671682098825004.45833333331163.213348765431306.32831790124
522726427256.967978395125381.08333333331875.884645061737.03202160493674
532734928506.18094135825744.3752761.80594135803-1157.18094135803
543063229375.833719135826019.83333333333356.000385802471256.1662808642
552942928205.120756172826111.95833333332093.162422839511223.87924382716
563008428485.967978395126098.83333333332387.134645061731598.03202160494
572629026362.231867284026136.7916666667225.440200617284-72.2318672839538
582437924661.972608024726320.9583333333-1658.98572530864-282.972608024695
592333523530.074459876526635.125-3105.05054012346-195.074459876549
602134621999.361496913626965.25-4965.88850308642-653.361496913582
612110623914.329089506227313.1666666667-3398.83757716049-2808.32908950617
622451426959.662422839527693.5416666667-733.879243827162-2445.66242283949
632835329312.671682098828149.45833333331163.21334876543-959.671682098757
643080530519.426311728428643.54166666671875.88464506173285.573688271608
653134831886.222608024729124.41666666672761.80594135803-538.222608024687
663455633010.875385802529654.8753356.000385802471545.12461419754
673385532421.745756172830328.58333333332093.162422839511433.25424382716
683478733571.967978395131184.83333333332387.134645061731215.03202160494
693252932333.773533950632108.3333333333225.440200617284195.226466049382
702999831262.68094135832921.6666666667-1658.98572530864-1264.68094135802
712925730626.282793209933731.3333333333-3105.05054012346-1369.28279320987
722815529597.111496913634563-4965.88850308642-1442.11149691358
733046631953.370756172835352.2083333333-3398.83757716049-1487.37075617284
743570435376.704089506236110.5833333333-733.879243827162327.295910493835
753932737848.380015432136685.16666666671163.213348765431478.61998456791
763935139085.759645061737209.8751875.88464506173265.240354938273
774223440493.597608024737731.79166666672761.805941358031740.40239197531
784363041515.292052469138159.29166666673356.000385802472114.70794753086
794372240647.954089506238554.79166666672093.162422839513074.04591049383
804312141265.384645061738878.252387.134645061731855.61535493828
813798539346.523533950639121.0833333333225.440200617284-1361.52353395061
823713537763.889274691439422.875-1658.98572530864-628.889274691355
833464636534.116126543239639.1666666667-3105.05054012346-1888.11612654322
843302634732.736496913639698.625-4965.88850308642-1706.73649691358
853508736351.370756172839750.2083333333-3398.83757716049-1264.37075617284
863884639056.329089506239790.2083333333-733.879243827162-210.329089506173
874201341241.421682098840078.20833333331163.21334876543771.578317901236
884390842429.259645061740553.3751875.884645061731478.74035493828
894286843890.722608024741128.91666666672761.80594135803-1022.72260802468
904442345013.750385802541657.753356.00038580247-590.750385802465
914416744218.079089506242124.91666666672093.16242283951-51.0790895061727
924363645088.051311728442700.91666666672387.13464506173-1452.0513117284
934438243316.273533950643090.8333333333225.4402006172841065.72646604939
944214241701.097608024743360.0833333333-1658.98572530864440.902391975316
954345240683.699459876543788.75-3105.050540123462768.30054012346
963691239224.194830246944190.0833333333-4965.88850308642-2312.19483024692
974241340990.287422839544389.125-3398.837577160491422.71257716049
984534443919.204089506244653.0833333333-733.8792438271621424.79591049383
994487346173.088348765445009.8751163.21334876543-1300.08834876544
1004751047170.967978395145295.08333333331875.88464506173339.032021604944
1014955448048.05594135845286.252761.805941358031505.94405864198
1024736948590.208719135845234.20833333333356.00038580247-1221.2087191358
1034599847184.954089506245091.79166666672093.16242283951-1186.95408950617
1044814046909.426311728444522.29166666672387.134645061731230.57368827161
1054844144041.481867283943816.0416666667225.4402006172844399.51813271605
1064492841391.847608024743050.8333333333-1658.985725308643536.15239197531
1074045439057.199459876542162.25-3105.050540123461396.80054012345
1083866136361.278163580241327.1666666667-4965.888503086422299.72183641975
1093724637092.079089506240490.9166666667-3398.83757716049153.920910493827
1103684338777.954089506239511.8333333333-733.879243827162-1934.95408950617
1113642439550.338348765438387.1251163.21334876543-3126.33834876543
1123759439246.384645061737370.51875.88464506173-1652.38464506172
1133814439442.889274691436681.08333333332761.80594135803-1298.88927469136
1143873739469.125385802536113.1253356.00038580247-732.125385802472
1153456037861.954089506235768.79166666672093.16242283951-3301.95408950617
1163608038029.926311728435642.79166666672387.13464506173-1949.92631172839
1173350835875.231867283935649.7916666667225.440200617284-2367.23186728395
1183546234017.80594135835676.7916666667-1658.985725308641444.19405864199
1193337432631.074459876535736.125-3105.05054012346742.925540123455
1203211031090.319830246936056.2083333333-4965.888503086421019.68016975309
12135533NA36696.3333333333NANA
12235532NA37403.25NANA
12337903NA38128.3333333333NANA
12436763NA38913.3333333333NANA
12540399NA39722.5416666667NANA
12644164NANANANA
12744496NANANANA
12843110NANANANA
12943880NANANANA
13043930NANANANA
13144327NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/1ougi1292689535.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/1ougi1292689535.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/2ougi1292689535.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/2ougi1292689535.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/3ougi1292689535.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/3ougi1292689535.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/4z4xl1292689535.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292689555jfdupsh6mtppgcd/4z4xl1292689535.ps (open in new window)


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