Home » date » 2010 » Jan » 13 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Wed, 13 Jan 2010 13:49:56 -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/13/t12634162081nkhy909kbotuvm.htm/, Retrieved Wed, 13 Jan 2010 21:56:54 +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/13/t12634162081nkhy909kbotuvm.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:
KDGP2W51
 
Dataseries X:
» Textbox « » Textfile « » CSV «
8357,00 7454,00 8076,00 7248,00 7339,00 7292,00 7359,00 7537,00 7441,00 8057,00 8037,00 8257,00 8692,00 8119,00 8236,00 7432,00 7669,00 7453,00 7566,00 7731,00 7657,00 8130,00 8401,00 8737,00 9009,00 7919,00 8228,00 7903,00 7912,00 7857,00 7965,00 8091,00 8024,00 8772,00 8656,00 8953,00 9014,00 8103,00 8876,00 8231,00 8173,00 8087,00 8296,00 8007,00 8382,00 9168,00 9137,00 9321,00 9234,00 8451,00 9101,00 8279,00 8284,00 8225,00 8597,00 8305,00 8620,00 9102,00 9258,00 9652,00 9522,00 8874,00 9415,00 8525,00 8862,00 8421,00 8626,00 8750,00 8852,00 9412,00 9570,00 9513,00 9986,00 8907,00 9663,00 8799,00 8931,00 8732,00 8936,00 9127,00 9070,00 9773,00 9670,00 9929,00 10095,00 9025,00 9659,00 8954,00 9022,00 8855,00 9034,00 9196,00 9038,00 9650,00 9715,00 10052,00 10436,00 9314,00 9717,00 8997,00 9062,00 8885,00 9058,00 9095,00 9149,00 9857,00 9848,00 10269,00 10341,00 9690,00 10125,00 9349,00 9224,00 9 etc...
 
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'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
18357NANA860.342948717949NA
27454NANA-88.964743589743NA
38076NANA475.996794871795NA
47248NANA-460.567307692308NA
57339NANA-382.625NA
67292NANA-532.615384615385NA
773597319.932692307697718.45833333333-398.52564102564139.0673076923076
875377343.275641025647760.125-416.849358974359193.724358974359
974417444.455128205137794.5-350.044871794872-3.45512820512704
1080578082.836538461547808.83333333333274.003205128205-25.8365384615372
1180378174.868589743597830.25344.618589743590-137.868589743590
1282578525.93910256417850.70833333333675.230769230769-268.9391025641
1386928726.384615384617866.04166666667860.342948717949-34.3846153846134
1481197793.785256410267882.75-88.964743589743325.214743589743
1582368375.830128205137899.83333333333475.996794871795-139.830128205127
1674327451.307692307697911.875-460.567307692308-19.3076923076896
1776697547.458333333337930.08333333333-382.625121.541666666669
1874537432.634615384617965.25-532.61538461538520.3653846153866
1975667599.932692307697998.45833333333-398.525641025641-33.9326923076915
2077317586.483974358978003.33333333333-416.849358974359144.516025641026
2176577644.62179487187994.66666666667-350.04487179487212.3782051282069
2281308287.961538461548013.95833333333274.003205128205-157.961538461537
2384018388.326923076928043.70833333333344.61858974359012.6730769230771
2487378745.897435897438070.66666666667675.230769230769-8.89743589743466
2590098964.467948717958104.125860.34294871794944.5320512820526
2679198046.785256410258135.75-88.964743589743-127.785256410255
2782288642.038461538468166.04166666667475.996794871795-414.038461538461
2879037747.516025641028208.08333333333-460.567307692308155.483974358976
2979127862.833333333338245.45833333333-382.62549.1666666666679
3078577732.467948717958265.08333333333-532.615384615385124.532051282053
3179657875.766025641038274.29166666667-398.52564102564189.2339743589746
3280917865.31730769238282.16666666667-416.849358974359225.682692307693
3380247966.788461538468316.83333333333-350.04487179487257.2115384615408
3487728631.50320512828357.5274.003205128205140.496794871795
3586568726.660256410268382.04166666667344.618589743590-70.6602564102559
3689539077.730769230778402.5675.230769230769-124.730769230770
3790149286.217948717958425.875860.342948717949-272.217948717948
3881038347.201923076928436.16666666667-88.964743589743-244.201923076923
3988768923.580128205138447.58333333333475.996794871795-47.580128205127
4082318018.432692307698479-460.567307692308212.567307692309
4181738132.916666666678515.54166666667-382.62540.0833333333339
4280878018.301282051288550.91666666667-532.61538461538568.6987179487169
4382968176.891025641038575.41666666667-398.525641025641119.108974358973
4480078182.233974358978599.08333333333-416.849358974359-175.233974358973
4583828272.913461538468622.95833333333-350.044871794872109.086538461539
4691688908.336538461548634.33333333333274.003205128205259.663461538461
4791378985.576923076928640.95833333333344.618589743590151.423076923078
4893219326.56410256418651.33333333333675.230769230769-5.56410256410345
4992349529.967948717958669.625860.342948717949-295.967948717947
5084518605.61858974368694.58333333333-88.964743589743-154.618589743590
5191019192.913461538468716.91666666667475.996794871795-91.913461538461
5282798263.516025641038724.08333333333-460.56730769230815.4839743589746
5382848343.758726.375-382.625-59.7500000000018
5482258212.592948717958745.20833333333-532.61538461538512.4070512820526
5585978372.474358974368771-398.525641025641224.525641025641
5683058383.775641025648800.625-416.849358974359-78.7756410256407
5786208481.288461538468831.33333333333-350.044871794872138.711538461539
5891029128.669871794878854.66666666667274.003205128205-26.6698717948730
5992589233.618589743598889344.61858974359024.381410256412
6096529596.480769230778921.25675.23076923076955.5192307692305
6195229790.967948717958930.625860.342948717949-268.967948717949
6288748861.410256410268950.375-88.96474358974312.5897435897441
6394159454.580128205138978.58333333333475.996794871795-39.580128205127
6485258540.599358974369001.16666666667-460.567307692308-15.5993589743575
6588628644.458333333339027.08333333333-382.625217.541666666666
6684218501.676282051289034.29166666667-532.615384615385-80.6762820512813
6786268649.307692307699047.83333333333-398.525641025641-23.3076923076915
6887508651.692307692319068.54166666667-416.84935897435998.3076923076915
6988528730.205128205139080.25-350.044871794872121.794871794873
7094129376.00320512829102274.00320512820535.9967948717949
7195709460.910256410269116.29166666667344.618589743590109.089743589744
7295139807.355769230779132.125675.230769230769-294.355769230770
73998610018.34294871799158860.342948717949-32.3429487179492
7489079097.660256410269186.625-88.964743589743-190.660256410258
7596639687.413461538469211.41666666667475.996794871795-24.4134615384628
7687998774.974358974369235.54166666667-460.56730769230824.0256410256425
7789318872.1259254.75-382.62558.875
7887328743.634615384629276.25-532.615384615385-11.6346153846152
7989368899.599358974369298.125-398.52564102564136.4006410256388
8091278890.733974358979307.58333333333-416.849358974359236.266025641027
8190708962.288461538469312.33333333333-350.044871794872107.711538461541
8297739592.62820512829318.625274.003205128205180.371794871795
8396709673.49358974369328.875344.618589743590-3.49358974358802
84992910013.02243589749337.79166666667675.230769230769-84.0224358974356
851009510207.34294871809347860.342948717949-112.342948717951
8690259264.99358974369353.95833333333-88.964743589743-239.99358974359
8796599831.49679487189355.5475.996794871795-172.496794871795
8889548888.474358974369349.04166666667-460.56730769230865.5256410256407
8990228963.166666666679345.79166666667-382.62558.833333333334
9088558820.176282051289352.79166666667-532.61538461538534.8237179487187
9190348973.599358974369372.125-398.52564102564160.4006410256407
9291968981.525641025649398.375-416.849358974359214.474358974361
9390389062.788461538469412.83333333333-350.044871794872-24.788461538461
9496509691.044871794879417.04166666667274.003205128205-41.044871794873
9597159765.11858974369420.5344.618589743590-50.118589743588
961005210098.64743589749423.41666666667675.230769230769-46.6474358974374
971043610286.00961538469425.66666666667860.342948717949149.990384615383
9893149333.49358974369422.45833333333-88.964743589743-19.4935897435898
9997179898.87179487189422.875475.996794871795-181.871794871795
10089978975.55769230779436.125-460.56730769230821.4423076923067
10190629067.666666666679450.29166666667-382.625-5.66666666666606
10288858932.259615384629464.875-532.615384615385-47.2596153846152
10390589071.432692307699469.95833333333-398.525641025641-13.4326923076915
10490959064.817307692319481.66666666667-416.84935897435930.1826923076915
10591499164.288461538469514.33333333333-350.044871794872-15.2884615384610
10698579820.00320512829546274.00320512820536.9967948717949
10798489912.035256410269567.41666666667344.618589743590-64.0352564102577
1081026910263.52243589749588.29166666667675.2307692307695.47756410256261
1091034110479.25961538469618.91666666667860.342948717949-138.259615384615
11096909556.951923076929645.91666666667-88.964743589743133.048076923076
1111012510144.12179487189668.125475.996794871795-19.1217948717949
11293499222.432692307699683-460.567307692308126.567307692309
11392249316.041666666679698.66666666667-382.625-92.041666666666
11492249195.551282051289728.16666666667-532.61538461538528.4487179487169
11594549363.057692307699761.58333333333-398.52564102564190.9423076923085
11693479364.067307692319780.91666666667-416.849358974359-17.0673076923085
11794309452.205128205139802.25-350.044871794872-22.2051282051270
118993310094.00320512829820274.003205128205-161.003205128203
1191014810171.66025641039827.04166666667344.618589743590-23.6602564102559
1201067710521.56410256419846.33333333333675.230769230769155.435897435897
1211073510713.84294871799853.5860.34294871794921.1570512820526
12297609758.951923076939847.91666666667-88.9647435897431.04807692307440
1231056710329.58012820519853.58333333333475.996794871795237.419871794873
12493339409.30769230779869.875-460.567307692308-76.3076923076896
12594099498.1259880.75-382.625-89.125
12695029355.092948717959887.70833333333-532.615384615385146.907051282053
12793489510.141025641039908.66666666667-398.525641025641-162.141025641025
12893199511.983974358979928.83333333333-416.849358974359-192.983974358973
12995949599.830128205139949.875-350.044871794872-5.83012820512522
1301016010239.25320512829965.25274.003205128205-79.2532051282051
1311018210317.32692307699972.70833333333344.618589743590-135.326923076922
1321081010651.98076923089976.75675.230769230769158.019230769230
1331110510850.92628205139990.58333333333860.342948717949254.073717948717
13498749924.2019230769210013.1666666667-88.964743589743-50.201923076922
1351095810492.038461538510016.0416666667475.996794871795465.961538461539
13693119554.182692307710014.75-460.567307692308-243.182692307693
13796109638.8333333333310021.4583333333-382.625-28.8333333333339
13893989493.6346153846110026.25-532.615384615385-95.6346153846134
13997849632.7243589743610031.25-398.525641025641151.275641025641
14094259633.942307692310050.7916666667-416.849358974359-208.942307692305
14195579712.9134615384610062.9583333333-350.044871794872-155.913461538461
1421016610349.461538461510075.4583333333274.003205128205-183.461538461541
1431033710437.410256410310092.7916666667344.618589743590-100.410256410256
1441077010782.105769230810106.875675.230769230769-12.1057692307713
1451126510968.634615384610108.2916666667860.342948717949296.365384615385
1461018310023.951923076910112.9166666667-88.964743589743159.048076923076
1471094110610.288461538510134.2916666667475.996794871795330.711538461539
14896289696.1826923076910156.75-460.567307692308-68.1826923076915
14997099805.5416666666710188.1666666667-382.625-96.541666666666
15096379685.5929487179510218.2083333333-532.615384615385-48.5929487179474
15195799846.8493589743610245.375-398.525641025641-267.849358974358
15297419863.0256410256410279.875-416.849358974359-122.025641025639
15397549949.7051282051310299.75-350.044871794872-195.705128205129
1541050810576.544871794910302.5416666667274.003205128205-68.5448717948711
1551074910654.035256410310309.4166666667344.61858974359094.9647435897441
1561107910989.189102564110313.9583333333675.23076923076989.8108974358984
1571160811177.967948717910317.625860.342948717949430.032051282051
1581066810230.326923076910319.2916666667-88.964743589743437.673076923078
1591093310794.580128205110318.5833333333475.996794871795138.419871794873
16097039859.8493589743610320.4166666667-460.567307692308-156.849358974358
16197999931.4166666666710314.0416666667-382.625-132.416666666666
16296569766.7179487179510299.3333333333-532.615384615385-110.717948717949
16396489877.557692307710276.0833333333-398.525641025641-229.557692307691
16497129824.7339743589710241.5833333333-416.849358974359-112.733974358973
16597669851.496794871810201.5416666667-350.044871794872-85.4967948717931
1661054010433.919871794910159.9166666667274.003205128205106.080128205131
1671056410467.160256410310122.5416666667344.61858974359096.839743589746
1681091110757.272435897410082.0416666667675.230769230769153.727564102564
16911218NA10037.4166666667NANA
17010230NANANANA
17110410NANANANA
1729227NANANANA
1739378NANANANA
1749105NANANANA
1759128NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/1tsxy1263415793.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/1tsxy1263415793.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/2mzpi1263415793.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/2mzpi1263415793.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/3p8ka1263415793.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/3p8ka1263415793.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/42j6y1263415793.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/13/t12634162081nkhy909kbotuvm/42j6y1263415793.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