Home » date » 2010 » Dec » 16 »

W8

*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: Thu, 16 Dec 2010 13:47:24 +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/16/t1292507134xa6lak2bk5y5xrk.htm/, Retrieved Thu, 16 Dec 2010 14:45:34 +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/16/t1292507134xa6lak2bk5y5xrk.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 time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
118561856000
218341849.00677901170-0.866277322744983-2.24329946878328-0.0855713141816245
320951932.982728586657.9131536013559330.30376663861560.920773758514936
421642016.6903544067514.204107341956725.10149357506640.845636642814966
523682140.4993399671421.800006815134743.15130170682411.26244008784519
620722130.1591196316019.8672794969790-2.25688091100772-0.379845280563682
725212261.3334919879725.86268096987161.19009551489151.34105053873475
818232136.3204132556818.3974008317198-39.423965567844-1.84325536953674
919472077.5142286189914.819540044996811.4327606166553-0.952552636611803
1022262126.3869630815716.319306892390836.43839553372870.423076534649782
1117542017.5107232980011.0227401364538-29.7753476532942-1.56298930805744
1217861944.169365211687.567255415007550.0449619722944906-1.05681731523340
1320721990.990090919084.20691014016583-16.16710472336390.710048144374171
1418461954.188398160442.45128100765119-44.1090784671614-0.45299504641554
1521372009.062084673914.9190467691873346.49790702426930.582329714445175
1624662159.9259935200211.144898508520264.53378281883911.70811593476162
1721542163.9053118031510.86806297985812.46546559649123-0.0867712600011075
1822892218.098866527112.4188735100711-5.757415679231320.535093639741788
1926282330.5852784613215.809850826556117.8115086772491.25006117520687
2020742281.1393035504713.6810739621624-89.0272948122377-0.820636891225523
2127982439.3495913560618.275313746458895.74821969953031.82465241401208
2221942371.6776787487915.5910108578911-20.8768197803889-1.08751312069146
2324422402.1008110494716.046871022389312.78585107872770.187936077363493
2425652464.6966075225317.362458955682914.70726128471800.591781327679578
2520632402.0414545873818.2262497356037-177.717587410971-1.16202972002217
2620692326.6527743298715.2896804840721-99.1994137369548-1.12764028825202
2725392389.4408105715117.05521436963471.98232487767170.559061662224207
2818982234.4863556497810.8855774559520-47.9633952541951-2.07263573808604
2921392203.888170781519.48167372399566.39970239554116-0.509872288447007
3024082275.6383758232611.490511089714723.7365582540780.77463554178737
3127252381.0922752535414.4206572437398178.5626012303721.17701918071131
3222012382.6391324647314.0281865425366-158.873148092259-0.161888137601245
3323112336.7577536476812.228347937205680.4821492963715-0.75498019042137
3425482409.9822064980314.041690932493929.67702805371850.769569425607615
3522762384.5075582180412.8870730139018-38.2198331649597-0.498952397018952
3623512368.5890262951612.119064612331933.8923124572294-0.364724296551222
3722802385.4228090064112.1738123286146-114.1750313547060.0633912775576905
3820572327.9425959889510.1614584059506-151.065283217200-0.861337316732986
3924792336.6680522539610.1134980330295144.722248268373-0.0173292191185292
4023792366.8621436716610.7826949329479-21.64302913124770.244871985749692
4122952360.0731609459110.2148201791189-35.0685691830888-0.216973648711578
4224562395.7300632213511.013160268360316.38057951713230.316754826213950
4325462395.6113802955110.6714660933779169.707030922128-0.139247368484586
4428442573.3969112935815.7247658343628-20.37917102946142.09580207960602
4522602488.9497636873112.7262446978074-54.2088309625798-1.25797540059087
4629812620.7610132066016.2589540615583152.2876597018141.49648733015764
4726782665.735656058517.095384275869-37.9250117311980.360960125513249
4834402893.8166180825322.839008243436176.5261102308002.65674965561724
4928422938.6865189435223.3039260859963-135.9731232082710.285899440905705
5024502862.1082608463220.436601228407-239.893831489386-1.24575796097112
5126692771.6873715951516.925465981250083.6828521885968-1.35570838740394
5225702720.3611043190114.7418390907276-35.2655862715918-0.838064950177667
5325402685.0285955435213.1628254858881-59.7967375329949-0.61983686308221
5423182581.092111733249.53422684537268-62.3421865883817-1.45797980804168
5529302645.2158478958511.2018569394381190.7934897678720.681986063803361
5629472742.3136574940913.798853242254756.44272210159411.07500750391916
5727992804.9578516989615.2642823010650-90.36182156025810.611829607801072
5826952753.5112814233213.279017223123356.8329688057498-0.83582675836851
5924982717.707033104911.8411970288735-134.821884037423-0.614846815481384
6022602538.595231663086.4811176834421851.8947803347048-2.39453214173193
6121602444.553695585243.91505879898997-108.927604101295-1.28159821299290
6220582381.705370759751.97750226012180-208.804096629078-0.834769491784797
6325332387.041718765142.08106806611763140.2796465968190.0413896400698018
6421502321.48386585283-0.0295257670351129-57.1638598374745-0.83428850609375
6521722280.31463812709-1.30568991996116-38.3765083462462-0.510109454238787
6621552265.23305283238-1.7288004246389-86.6928938143915-0.171541391207341
6730162432.572909235173.4170577072288293.5954617249562.11056718405261
6823332405.636008294082.49979619006629-20.5116395942459-0.37939309740531
6923552409.221036617442.53239547215348-56.08607667460490.0135704865723837
7028252504.089159992865.28732946332533162.1987227971451.15451019275586
7122142448.348194544633.48802114676725-129.483953671453-0.762654530428371
7223602395.470670157151.867324558157261.3812330177369-0.704925769813531
7322992388.720445655051.62873780590411-74.8265596620747-0.108848510766505
7417462262.59654976619-2.12063781186515-297.256858216115-1.59790282059093
7520692146.95076894006-5.57380209694953114.591506381698-1.40517554730947
7622672180.80053256943-4.3626014705293119.44581874409660.487744441805661
7718782105.38376152757-6.54164654893659-106.633113771674-0.882131294759222
7822662182.64700000811-3.98550420144873-59.60530003774851.04374403211719
7922822127.30570945422-5.54307626358428242.514255916826-0.640830163878807
8020852116.22022759429-5.71034662183146-21.7307155127993-0.0692189309974396
8122772181.08825270887-3.58981717229625-24.98150400694810.881584589889836
8222512149.46830874801-4.42757764030574149.535617282821-0.34998674507118
8318282082.93893196887-6.26835944877092-148.656071633200-0.774877496247055
8419542014.26624048412-8.0919415484933246.5110015635037-0.779185214010929
8518511962.56448749359-9.34674068712734-36.6427525560592-0.548010317868758
8615701913.9503117304-10.5086568322436-276.675434166961-0.490968361799109
8718521854.71095453821-11.980777000926980.0816850315142-0.604772216961945
8821871926.65477727655-9.42691385557034118.0500403463911.04044934941535
8918551942.19192299707-8.66730999875547-129.6149872529380.310207423429667
9022182029.56573811184-5.7533903467099324.76377228034181.19633064528540
9122532028.00783311825-5.62653891135796217.8286153519860.0523391431891837
9220282036.93750489552-5.18788624879428-33.81421009260950.181697849112385
9321692074.20116509741-3.9127545082271222.23739445439630.529862829729522
9419972001.13464696845-5.98202638660238114.01739906272-0.862665377193845
9520342036.44230017994-4.75329285654099-72.92968107378320.514710364202021
9617911946.62220650160-7.26467637208701-10.4273775533224-1.06114206637846
9716271851.54785805209-9.8405711001353-74.2157290592173-1.10015617688115
9816311852.15693140741-9.52971464220552-239.0289050457370.130581166644055
9923191966.09050293135-5.81293480165451142.9595791616021.53466733064561
10017071867.14913930592-8.63045763261929-2.10266222141391-1.15618207381797
10117471867.95037643218-8.34496784084239-136.9792095808390.117275995325598
10223972007.41238061928-3.87760144756737137.8552474284561.84135890111606
10320591969.15952661878-4.91439060864137148.475365143973-0.428757976994958
10422512056.93713581241-2.1248396301016635.84749371212041.15660545882873
10525582191.966495255931.99342062243652131.9332611205101.71102448419760
10624062233.479759718993.1769030338036105.1050672742380.492697820953331
10720492197.784413799262.01692405691674-82.5289336980783-0.4843128082832
10820742157.876509339140.771393894626389-12.4229404343499-0.522692009093206
10917342060.04507720472-2.15036893325859-157.596006541382-1.23315430640682
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/1t3271292507239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/1t3271292507239.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/2t3271292507239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/2t3271292507239.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/3muks1292507239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/3muks1292507239.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/4fl1v1292507239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/4fl1v1292507239.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/5fl1v1292507239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292507134xa6lak2bk5y5xrk/5fl1v1292507239.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