Home » date » 2010 » Dec » 29 »

*The author of this computation has been verified*
R Software Module: /rwasp_structuraltimeseries.wasp (opens new window with default values)
Title produced by software: Structural Time Series Models
Date of computation: Wed, 29 Dec 2010 14:42:18 +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/29/t129363360024i2eodvjckcebl.htm/, Retrieved Wed, 29 Dec 2010 15:40:06 +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/29/t129363360024i2eodvjckcebl.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 «
1856 1834 2095 2164 2368 2072 2521 1823 1947 2226 1754 1786 2072 1846 2137 2466 2154 2289 2628 2074 2798 2194 2442 2565 2063 2069 2539 1898 2139 2408 2725 2201 2311 2548 2276 2351 2280 2057 2479 2379 2295 2456 2546 2844 2260 2981 2678 3440 2842 2450 2669 2570 2540 2318 2930 2947 2799 2695 2498 2260 2160 2058 2533 2150 2172 2155 3016 2333 2355 2825 2214 2360 2299 1746 2069 2267 1878 2266 2282 2085 2277 2251 1828 1954 1851 1570 1852 2187 1855 2218 2253 2028 2169 1997 2034 1791 1627 1631 2319 1707 1747 2397 2059 2251 2558 2406 2049 2074 1734
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
118561856000
218341849.00401376043-0.866462741645097-2.24138791113759-0.0855674077443585
320951933.000068499017.9120739992435430.27390939581640.920814634266865
421642016.7127715875914.201114701833825.08213068910670.845563690284613
523682140.5320487657421.794875750635843.11668689245721.26237592739167
620722130.1663751034519.8617121680156-2.23569239351824-0.380016029024471
725212261.3628071483225.856199076803661.13871537217571.34112305919828
818232136.2966490087418.3915213148299-39.3565272526978-1.84344776585951
919472077.4848260211514.815016153619411.4390488237704-0.952346721962866
1022262126.3785505976716.315363492608636.41009956340550.423300385229205
1117542017.4707787144211.0194791721335-29.7247098481464-1.56298140119547
1217861944.126377248457.565171384286820.0591258798614192-1.05657203296087
1320721990.963283916244.2020392547632-16.16050830593000.710194717180928
1418461954.141027159932.44566442592975-44.0540259228977-0.453025048240505
1521372009.048774323184.9146879075032346.45907587968670.582652112027052
1624662159.9499980089211.140083244538764.4640137304991.70827586330405
1721542163.9173606296310.86308405911972.46440825733971-0.086840065289077
1822892218.1036543148512.4131555817080-5.748918671672320.534950655984567
1926282330.6337570249815.8043479617601117.6977311076281.25039984990017
2020742281.1289213180613.6747461120318-88.9364967324584-0.821120371188022
2127982439.3817161009818.268580157299595.66441099112541.82484521325883
2221942371.6766557811315.5845803948641-20.8502603530585-1.08759196202597
2324422402.0976603534216.040387204589612.78513237317040.187946057405880
2425652464.6963336425417.355749284689914.70355539130650.591757011560477
2520632402.0188797937218.2222123787923-177.687726262595-1.16201889448117
2620692326.5821876052515.2844475949366-99.0895446452328-1.12782875331418
2725392389.410531629917.051258692577771.94975405480320.559463970507761
2818982234.4318224538410.8830472682195-47.9082378101042-2.07243240584179
2921392203.843869398669.48014051105196.41385312759767-0.509604565413696
3024082275.6227823646511.489101280633623.71259710532520.774838753687826
3127252381.1381944923914.4199471795924178.4269697496591.17753880719335
3222012382.6266489841614.0258873333501-158.761635421280-0.162576001144295
3323112336.7541341600912.227152012575780.451777000753-0.754663194328951
3425482409.9934963553114.040213723929529.65183493969650.769591630052417
3522762384.4958328388812.8854315314510-38.1794947117766-0.499106278086742
3623512368.5819630691412.117908188045433.8808509422194-0.364557047304815
3722802385.4161359478212.1725533680226-114.1701300567340.063399443341562
3820572327.8873757375410.1592773979396-150.951401315467-0.861682006720261
3924792336.6558890309910.1128392468197144.658733149978-0.0167790817292452
4023792366.8499537523410.7818402290727-21.62738644675350.244823544580364
4122952360.0485176057110.2138029055493-35.0279408920613-0.217067870507476
4224562395.7240870921311.012443743925216.35827901162310.316927589427486
4325462395.6394638260310.6719550042110169.616043005943-0.138780287798058
4428442573.4451269315715.7237965937197-20.42226364672892.09555971322776
4522602488.9455542347112.7249435159341-54.1387975858044-1.25832639425816
4629812620.8068451632816.2577783919955152.1809145232041.49678019660481
4726782665.7621175907717.0933551838880-37.91269949061490.360646363977283
4834402893.8991170809222.8360953038057176.3933580598482.65685016884167
4928422938.7390108904523.2999949757211-135.9723283964570.285488905055748
5024502862.075153492520.4312235045217-239.749285256507-1.2464512490544
5126692771.6425389501716.920829099577683.7070981314688-1.35544153240520
5225702720.309538639714.7378155760905-35.2273139203102-0.83789219359093
5325402684.9687034654813.1592177338961-59.7412705698716-0.619746752675726
5423182581.023296135859.53179944889732-62.2918662517905-1.45770808106484
5529302645.206458206411.2006842931147190.7094875369010.682599401332796
5629472742.3462732013613.797991875177756.3564850286511.07529534764335
5727992804.9629455929915.2620634339766-90.3088730239460.611351643824623
5826952753.5067165208013.277324617292256.8339747241062-0.835723001540595
5924982717.6754080319311.8393042714856-134.758462468735-0.615019709736363
6022602538.552083208956.4812231933030151.9076942854881-2.39408691438801
6121602444.510405887263.91682343995129-108.907279511997-1.28132608902420
6220582381.635580236111.97912774313349-208.704077553093-0.834914159066098
6325332387.001123702852.08351292572281140.2745887788560.0417188277800402
6421502321.43473370249-0.0267652538521386-57.1136880869589-0.83422318567053
6521722280.26567939317-1.30257983175175-38.3332987440948-0.510021742405173
6621552265.18459602348-1.72562061020482-86.6433597727155-0.171533679977553
6730162432.613573650383.42098343655144293.4493341281352.11114338629866
6823332405.674383844472.50387041773582-20.5469214096226-0.37938121631614
6923552409.246830418362.53595760672286-56.0829783496150.0133590522323261
7028252504.145607149215.29069178689218162.1188308882651.15457646958223
7122142448.367726851313.49086567228421-129.449506415065-0.762977960121812
7223602395.477268313331.8703782492975961.3876679160496-0.7049564700646
7322992388.726279425661.63180812406517-74.8278683188769-0.108872620591849
7417462262.54061257741-2.11810716165301-297.123617546189-1.5983244210972
7520692146.88895379273-5.57044025139316114.635788765717-1.40492822372487
7622672180.76661497741-4.358871874070319.44864966204940.487929812371759
7718782105.32636872957-6.53802464069114-106.547545733590-0.882260019418131
7822662182.61927647234-3.98197201754566-59.60092940124941.04382230096728
7922822127.31194626323-5.5380709547135242.443024553837-0.640299167523958
8020852116.23987097918-5.70502810286925-21.7661479162565-0.0690976463676675
8122772181.12587026067-3.58487897577327-25.02286254372120.881533975400648
8222512149.51279579999-4.42227990805325149.480722780880-0.349879948945289
8318282082.95325012733-6.26343536482708-148.625383508770-0.77513685000886
8419542014.26556831331-8.0868806860849746.5299202000564-0.779249442295863
8518511962.56479013236-9.34124191358312-36.6467867227512-0.547937700483472
8615701913.91562199681-10.5039318689200-276.581646333038-0.491356676252319
8718521854.66245356543-11.976127403835480.1482206233398-0.604852620666575
8821871926.65233894198-9.42183871789272118.0047285844971.04071032819889
8918551942.17187521455-8.66317904363502-129.5499473348170.309851790029715
9022182029.58521290353-5.7491853148546224.70850473660011.19648834672343
9122532028.0418463014-5.6220658167709217.7780333687760.0524556287423158
9220282036.97742852879-5.18352445364373-33.85285863111100.181672706971415
9321692074.26071609937-3.9083865094903222.16263342732180.529927760982713
9419972001.17639728716-5.9775820121492113.995851451709-0.862737707536558
9520342036.48627363584-4.74936232318035-72.95932436398230.514560753171482
9617911946.62550762319-7.26110378739564-10.3763785558530-1.06144687649336
9716271851.53088775974-9.83665587436138-74.179953205435-1.10020246269001
9816311852.12836095423-9.52637354476888-238.9710956265500.130356243790705
9923191966.08434302041-5.81027694954828142.9669423183311.53452832693994
10017071867.11689864009-8.62772817697718-2.04662736199526-1.15625865151546
10117471867.9135505837-8.34255613176523-136.9274956849130.117157091627650
10223972007.44664374147-3.87464698898578137.7420930471121.84177777839206
10320591969.18298054706-4.91149101521205148.466540089527-0.428827980104091
10422512056.99571563387-2.1219479526366435.75780736753371.15673309234974
10525582192.070962539541.99615022918312131.7907564025531.71115493565311
10624062233.565199522963.17856041062205105.0668990443090.492309840561236
10720492197.841303880332.01809952195158-82.5443521411148-0.48457406901269
10820742157.893471908020.771812322923348-12.3806992989925-0.523080327638101
10917342060.01427650079-2.15025908393324-157.507899649222-1.23347114126401
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/1av511293633729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/1av511293633729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/22m4m1293633729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/22m4m1293633729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/3dvlp1293633729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/3dvlp1293633729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/4dvlp1293633729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/4dvlp1293633729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/5642a1293633729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t129363360024i2eodvjckcebl/5642a1293633729.ps (open in new window)


 
Parameters (Session):
par1 = 12 ;
 
Parameters (R input):
par1 = 12 ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
nx <- length(x)
x <- ts(x,frequency=par1)
m <- StructTS(x,type='BSM')
m$coef
m$fitted
m$resid
mylevel <- as.numeric(m$fitted[,'level'])
myslope <- as.numeric(m$fitted[,'slope'])
myseas <- as.numeric(m$fitted[,'sea'])
myresid <- as.numeric(m$resid)
myfit <- mylevel+myseas
mylagmax <- nx/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(mylevel,na.action=na.pass,lag.max = mylagmax,main='Level')
acf(myseas,na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(myresid,na.action=na.pass,lag.max = mylagmax,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(mylevel,main='Level')
spectrum(myseas,main='Seasonal')
spectrum(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(mylevel,main='Level')
cpgram(myseas,main='Seasonal')
cpgram(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time',type='b')
grid()
dev.off()
bitmap(file='test5.png')
op <- par(mfrow = c(2,2))
hist(m$resid,main='Residual Histogram')
plot(density(m$resid),main='Residual Kernel Density')
qqnorm(m$resid,main='Residual Normal QQ Plot')
qqline(m$resid)
plot(m$resid^2, myfit^2,main='Sq.Resid vs. Sq.Fit',xlab='Squared residuals',ylab='Squared Fit')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Structural Time Series Model',6,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,'Level',header=TRUE)
a<-table.element(a,'Slope',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Stand. Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,mylevel[i])
a<-table.element(a,myslope[i])
a<-table.element(a,myseas[i])
a<-table.element(a,myresid[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