Home » date » 2009 » Dec » 01 »

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: Tue, 01 Dec 2009 11:56:03 -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/01/t1259693860wpsw07gh11e38fq.htm/, Retrieved Tue, 01 Dec 2009 19:57:45 +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/01/t1259693860wpsw07gh11e38fq.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 «
7291 6820 8031 7862 7357 7213 7079 7012 7319 8148 7599 6908 7878 7407 7911 7323 7179 6758 6934 6696 7688 8296 7697 7907 7592 7710 9011 8225 7733 8062 7859 8221 8330 8868 9053 8811 8120 7953 8878 8601 8361 9116 9310 9891 10147 10317 10682 10276 10614 9413 11068 9772 10350 10541 10049 10714 10759 11684 11462 10485 11056 10184 11082 10554 11315 10847 11104 11026 11073 12073 12328 11172
 
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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
17291NANA86.2659722222217NA
26820NANA-499.325694444444NA
38031NANA492.540972222223NA
47862NANA-266.450694444445NA
57357NANA-245.967361111112NA
67213NANA-243.709027777778NA
770797034.740972222227411.04166666667-376.30069444444544.259027777779
870127284.849305555557459.95833333333-175.109027777778-272.849305555555
973197592.649305555567479.41666666667113.23263888889-273.649305555556
1081488131.332638888897451.95833333333679.37430555555616.6673611111119
1175997882.040972222227422.08333333333459.957638888889-283.040972222222
1269087371.199305555557395.70833333333-24.5090277777786-463.199305555555
1378787456.974305555557370.7083333333386.2659722222217421.025694444445
1474076852.174305555567351.5-499.325694444444554.825694444444
1579117846.249305555567353.70833333333492.54097222222364.750694444444
1673237108.799305555567375.25-266.450694444445214.200694444445
1771797139.532638888897385.5-245.96736111111239.4673611111130
1867587187.499305555567431.20833333333-243.709027777778-429.499305555555
1969347084.615972222227460.91666666667-376.300694444445-150.615972222222
2066967286.515972222227461.625-175.109027777778-590.515972222222
2176887633.315972222227520.08333333333113.2326388888954.6840277777774
2282968282.874305555567603.5679.37430555555613.1256944444440
2376978124.124305555567664.16666666667459.957638888889-427.124305555555
2479077717.074305555557741.58333333333-24.5090277777786189.925694444446
2575927920.724305555567834.4583333333386.2659722222217-328.724305555555
2677107437.215972222227936.54166666667-499.325694444444272.784027777777
2790118519.374305555568026.83333333333492.540972222223491.625694444444
2882257810.965972222228077.41666666667-266.450694444445414.034027777776
2977337911.782638888898157.75-245.967361111112-178.782638888889
3080628008.207638888898251.91666666667-243.70902777777853.792361111111
3178597935.282638888898311.58333333333-376.300694444445-76.2826388888898
3282218168.599305555568343.70833333333-175.10902777777852.4006944444445
3383308461.524305555568348.29166666667113.23263888889-131.524305555557
3488689037.790972222228358.41666666667679.374305555556-169.790972222222
3590538860.207638888898400.25459.957638888889192.792361111111
3688118445.824305555568470.33333333333-24.5090277777786365.175694444444
3781208660.974305555568574.7083333333386.2659722222217-540.974305555555
3879538205.424305555568704.75-499.325694444444-252.424305555556
3988789342.582638888898850.04166666667492.540972222223-464.582638888889
4086018719.674305555558986.125-266.450694444445-118.674305555554
4183618868.407638888899114.375-245.967361111112-507.40763888889
4291168999.582638888899243.29166666667-243.709027777778116.417361111113
4393109031.949305555569408.25-376.300694444445278.050694444444
4498919397.890972222229573-175.109027777778493.109027777778
45101479838.315972222229725.08333333333113.23263888889308.684027777779
461031710544.49930555569865.125679.374305555556-227.499305555557
471068210456.74930555569996.79166666667459.957638888889225.250694444445
481027610114.532638888910139.0416666667-24.5090277777786161.467361111110
491061410315.474305555610229.208333333386.2659722222217298.525694444446
5094139794.9659722222210294.2916666667-499.325694444444-381.965972222222
511106810846.624305555610354.0833333333492.540972222223221.375694444445
52977210170.090972222210436.5416666667-266.450694444445-398.090972222222
531035010280.032638888910526-245.96736111111269.967361111112
541054110323.499305555610567.2083333333-243.709027777778217.500694444447
551004910218.032638888910594.3333333333-376.300694444445-169.032638888890
561071410469.765972222210644.875-175.109027777778244.234027777777
571075910790.815972222210677.5833333333113.23263888889-31.8159722222226
581168411390.124305555610710.75679.374305555556293.875694444445
591146211243.499305555610783.5416666667459.957638888889218.500694444445
601048510811.990972222210836.5-24.5090277777786-326.990972222224
611105610979.474305555610893.208333333386.265972222221776.5256944444427
621018410450.840972222210950.1666666667-499.325694444444-266.840972222222
631108211468.790972222210976.25492.540972222223-386.790972222221
641055410739.090972222211005.5416666667-266.450694444445-185.090972222224
651131510811.865972222211057.8333333333-245.967361111112503.134027777778
661084710878.832638888911122.5416666667-243.709027777778-31.8326388888891
6711104NANA-376.300694444445NA
6811026NANA-175.109027777778NA
6911073NANA113.23263888889NA
7012073NANA679.374305555556NA
7112328NANA459.957638888889NA
7211172NANA-24.5090277777786NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/1e04t1259693760.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/1e04t1259693760.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/2c7hn1259693760.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/2c7hn1259693760.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/36tou1259693760.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/36tou1259693760.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/444hm1259693761.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693860wpsw07gh11e38fq/444hm1259693761.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