Home » date » 2010 » Dec » 26 »

STSM Yuan

*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: Sun, 26 Dec 2010 13:34: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/26/t12933704489gelqhclm6j7am5.htm/, Retrieved Sun, 26 Dec 2010 14:34:13 +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/26/t12933704489gelqhclm6j7am5.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 «
7,4271 7,7662 7,6289 7,5281 7,3831 7,2355 7,0617 7,1237 7,4533 7,5411 7,4978 7,3525 7,3862 7,311 7,2013 7,249 7,3321 7,59 7,9082 8,2123 8,0929 8,118 8,1206 8,2883 8,4281 8,7917 8,9168 8,9446 8,9786 9,5862 9,6533 9,4125 9,2195 9,2882 9,6774 9,6857 10,1688 10,4399 10,4675 10,149 9,9163 9,9268 10,0529 10,1622 10,083 10,1134 10,3423 10,7536 11,0967 10,8588 10,7719 10,9262 10,708 10,5062 10,0683 9,8954 9,9589 9,9177 9,7189 9,5273 9,5746 9,763 9,6117 9,6581 9,8361 10,2353 10,1285 10,1347 10,2141 10,0971 9,9651 10,1286 10,3356 10,1238 10,1326 10,2467 10,44 10,3689 10,2415 10,3899 10,3162 10,4533 10,6741 10,8957 10,7404 10,6568 10,5682 10,9833 11,0237 10,8462 10,7287 10,7809 10,2609 9,8252 9,1071 8,695 9,2205 9,0496 8,7406 8,921 9,011 9,3157 9,5786 9,6246 9,7485 9,9431 10,1152 10,1827 9,9777 9,7436 9,3462 9,2623 9,1505 8,5794 8,3245 8,6538 8,752 8,8104 9,2665 9,0895
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
17.42717.4271000
27.76627.748566799278010.01763319952923590.01763320072199040.825877318167806
37.62897.611884064599560.01701593540044430.0170159354004442-0.661595985910299
47.52817.511551588180150.01654841181984620.0165484118198463-0.503101789956956
57.38317.367190119489470.01590988051052730.0159098805105273-0.689855194930098
67.23557.220233859213980.0152661407860180.015266140786018-0.698236648345201
77.06177.047175295103180.01452470489682250.0145247048968225-0.807375867194713
87.12377.108989844720970.01471015527902650.01471015527902650.202737000576945
97.45337.437364592336420.01593540766358250.01593540766358251.34470590560733
107.54117.524886047388920.01621395261107660.01621395261107660.306892949711581
117.49787.481815831002850.01598416899714840.0159841689971483-0.254152275382592
127.35257.337136154765030.01536384523497190.0153638452349720-0.688763596946793
137.38627.490827031203380.00951154773345023-0.1046270312033760.716470157387364
147.3117.306188541130650.004811453868740140.00481145886935236-0.708145117511599
157.20137.196696371179130.004603628820868750.00460362882086866-0.489519150764006
167.2497.244318298031870.004681701968131930.004681701968131970.184230783904569
177.33217.327276492771230.004823507228764480.004823507228764550.335227487381897
187.597.584719675932750.005280324067252840.005280324067252831.08186912529155
197.90827.902355856617330.005844143382673130.005844143382673121.33769313735252
208.21238.205919425145030.006380574854974250.006380574854974261.27500918252747
218.09298.086745243084930.006154756915067790.00615475691506778-0.537698233757084
228.1188.111811291031630.006188708968369010.006188708968369020.080988977620993
238.12068.114417710905460.006182289094539320.0061822890945393-0.0153413886407199
248.28838.28182928638140.006470713618607320.006470713618607380.690473917528906
258.42818.461791334254790.00306284801665976-0.03369133425478890.818601556492607
268.79178.783685169401020.008014822471157760.008014830598977781.24003322931279
278.91688.908647591838220.008152408161777940.008152408161777870.500681867600775
288.94468.936424531279380.0081754687206160.008175468720616040.0840174597427016
298.97868.970394256324030.008205743675966350.008205743675966340.110431498653719
309.58629.57729238936040.008907610639606190.008907610639606192.56314628831903
319.65339.644324328071470.008975671928526980.0089756719285270.248844074632262
329.41259.403816122144180.008683877855823370.00868387785582337-1.06809909581460
339.21959.211051459275630.008448540724371340.00844854072437132-0.862447943432769
349.28829.279681236114390.008518763885612430.008518763885612440.257649659802235
359.67749.668438068106710.008961931893286860.008961931893286871.62788517945411
369.68579.676738837795130.008961162204872280.00896116220487235-0.00283058303596371
3710.168810.19562721473610.00243883702459244-0.02682721473605722.3302832078919
3810.439910.43475494860310.005145042337246130.005145051396871490.946054341828682
3910.467510.46233544851620.005164551483825810.005164551483825740.0960370709468288
4010.14910.14411640741070.004883592589260550.00488359258926065-1.38427315174270
419.91639.911622464359830.004677535640168240.004677535640168-1.01611594756798
429.92689.92211741889530.004682581104697570.004682581104697580.0249019768194336
4310.052910.04811229555810.004787704441893350.004787704441893360.519287830573666
4410.162210.15732188697150.004878113028524470.004878113028524450.44698680027863
4510.08310.07819455606190.004805443938105910.00480544393810588-0.359592338651841
4610.113410.10857245367540.004827546324582310.004827546324582320.109464988891711
4710.342310.33727912104460.005020878955371480.005020878955371490.958332613345804
4810.753610.74822888032090.005371119679112640.005371119679112711.73761062708716
4911.096711.11779320519670.00191756317614841-0.02109320519666071.63754274746305
5010.858810.8592388201639-0.00043882862533931-0.000438820163883977-1.05700731964457
5110.771910.7723984161219-0.000498416121887206-0.000498416121887273-0.369816768412151
5210.926210.9265918056032-0.000391805603189859-0.0003918056031898060.662113049167792
5310.70810.7085417080633-0.000541708063327919-0.000541708063328226-0.931622464493622
5410.506210.5068801250963-0.00068012509632438-0.000680125096324359-0.86083441836604
5510.068310.0692806199662-0.000980619966180281-0.000980619966180217-1.87010434255196
569.89549.89649869650684-0.00109869650683532-0.00109869650683532-0.73534455672841
579.95899.95995435970504-0.00105435970503512-0.001054359705035160.276305737273075
589.91779.91878189444785-0.00108189444784958-0.00108189444784959-0.171713578639576
599.71899.7201174106768-0.00121741067680137-0.00121741067680139-0.845693111439456
609.52739.52864780975836-0.00134780975835926-0.00134780975835916-0.814317341839422
619.57469.5572887373518-0.0015737523204210.01731126264818840.133525103871349
629.7639.76302221599718-2.22303268542917e-05-2.22159971758409e-050.849405033275063
639.61179.6118086257439-0.000108625743893207-0.000108625743893309-0.647092334169511
649.65819.65818207971288-8.20797128773598e-05-8.20797128773532e-050.198941214799181
659.83619.836080492628721.95073712810654e-051.95073712808516e-050.761748395622014
6610.235310.2350529095790.0002470904209961120.0002470904209961051.70749998983046
6710.128510.12831390509910.0001860949009136750.000186094900913739-0.457895460541517
6810.134710.13451048032250.0001895196775402220.0001895196775402160.0257245692638785
6910.214110.21386539750210.0002346024978590560.0002346024978590390.338824072597873
7010.097110.09693208388110.0001679161188847550.000167916118884758-0.501472933122704
719.96519.965007222013249.27779867556013e-059.27779867555776e-05-0.565350518289300
7210.128610.12841437695980.000185623040191710.0001856230401918030.698977295694115
7310.335610.3241947314723-0.001036844164257140.01140526852769790.865187932216387
7410.123810.1260944738573-0.0022944897398976-0.00229447385732355-0.812833396653992
7510.132610.1348890803987-0.00228908039872485-0.002289080398724960.0474588583440954
7610.246710.2489323605446-0.00223236054463706-0.002232360544637050.497876496958151
7710.4410.4421371182350-0.00213711823503504-0.002137118235035300.836427076632708
7810.368910.3710706931705-0.00217069317047501-0.00217069317047502-0.295001954014176
7910.241510.2437316320374-0.00223163203738306-0.00223163203738299-0.535692442765182
8010.389910.3920583675871-0.00215836758709928-0.002158367587099300.644355850244483
8110.316210.3183931472027-0.00219314720271426-0.00219314720271427-0.306033163223771
8210.453310.4554254634228-0.00212546342281789-0.002125463422817870.595853436012474
8310.674110.6761171945650-0.00201719456496722-0.002017194564967260.953606991469831
8410.895710.8976086424729-0.00190864247285206-0.001908642472851960.956566118672814
8510.740410.7291856447054-0.001019488035651760.0112143552945983-0.733096489221792
8610.656810.6582086272326-0.00140863983037296-0.00140862723257189-0.289969789961864
8710.568210.5696457269530-0.00144572695298487-0.00144572695298498-0.372989184023579
8810.983310.9845686240732-0.00126862407319025-0.001268624073190251.78190922424800
8911.023711.0249509153402-0.00125091534020962-0.001250915340209850.178251047854762
9010.846210.8475257875530-0.00132578755295218-0.00132578755295220-0.75396266519479
9110.728710.7300751184579-0.00137511845786048-0.00137511845786038-0.496972945510703
9210.780910.7822523785809-0.00135237858091410-0.001352378580914120.229184999542216
9310.260910.2624724243711-0.00157242437110091-0.00157242437110094-2.2186841393223
949.82529.8269565328663-0.00175653286630728-0.00175653286630727-1.85712227994783
959.10719.10916019708398-0.00206019708397825-0.00206019708397833-3.06439306605472
968.6958.69723394286558-0.00223394286557603-0.00223394286557591-1.75407929214146
979.22059.17149612413693-0.004454899698576980.04900387586307092.09041248191656
989.04969.05460915222478-0.00500917223789506-0.00500915222477997-0.467769222051947
998.74068.74572384318586-0.00512384318586281-0.00512384318586302-1.30045029130411
1008.9218.92605388693901-0.00505388693901072-0.005053886939010740.793657405081196
1019.0119.01601805808482-0.00501805808481796-0.005018058084818130.406633591233611
1029.31579.32060135941713-0.00490135941712902-0.004901359417129071.32495134319441
1039.57869.58340049254804-0.0048004925480378-0.00480049254803771.14563483398549
1049.62469.62938136584386-0.00478136584385678-0.004781365843856840.21732084594893
1059.74859.75323293473685-0.00473293473684889-0.00473293473684890.550489648082331
1069.94319.9477579411074-0.00465794110739321-0.004657941107393150.85273204979304
10710.115210.1197914657187-0.00459146571873962-0.004591465718739690.756157893846958
10810.182710.1872643636460-0.004564363645976-0.004564363645975820.308402182078795
1099.97779.93859600195647-0.003554910857741630.0391039980435285-1.06794725927161
1109.74369.74798286374374-0.00438288378423411-0.0043828637437393-0.780547988618482
1119.34629.35071606568596-0.00451606568596075-0.00451606568596104-1.68133044681761
1129.26239.26684295728252-0.00454295728251458-0.00454295728251455-0.339605162554386
1139.15059.15507927869193-0.00457927869193504-0.00457927869193530-0.458846589450193
1148.57948.58417105971429-0.00477105971428671-0.00477105971428675-2.42358085906393
1158.32458.32935570578031-0.00485570578030867-0.00485570578030855-1.07005396962358
1168.65388.65854266249459-0.00474266249458824-0.004742662494588311.42952134810355
1178.7528.7567078492587-0.00470784925870629-0.00470784925870630.44038973311464
1188.81048.81508651460832-0.00468651460832123-0.004686514608321170.269976021682733
1199.26659.27103079076425-0.00453079076425134-0.004530790764251381.97124951379478
1209.08959.09408905743197-0.00458905743197106-0.00458905743197088-0.737825117461123
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/1kfaa1293370472.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/1kfaa1293370472.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/2d79v1293370472.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/2d79v1293370472.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/3d79v1293370472.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/3d79v1293370472.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/45gqg1293370472.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/45gqg1293370472.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/5yp711293370472.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/26/t12933704489gelqhclm6j7am5/5yp711293370472.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
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time')
grid()
dev.off()
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='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