Home » date » 2009 » Dec » 04 »

*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: Fri, 04 Dec 2009 05:08:38 -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/04/t12599285800ey7p4ktaym5bwt.htm/, Retrieved Fri, 04 Dec 2009 13:09:51 +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/04/t12599285800ey7p4ktaym5bwt.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 «
17 14 15 16 16 15 13 12 13 13 12 10 14 14 15 16 16 15 15 13 15 15 15 13 16 16 14 16 15 14 15 15 14 13 12 13 12 9 10 8 11 8 8 8 4 6 8 10 5 6 5 9 8 6 9 11 11 8 11 11 13
 
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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11717000
21415.0330593463373-0.144548055205191-0.144548055091753-1.39601525305627
31515.0366808303117-0.138307627077558-0.1383076270775580.137928287429375
41615.5961311402861-0.119417418645176-0.1194174186451760.688758691943332
51615.8357560627452-0.112118441539720-0.1121184415397200.360365262724881
61515.3827831630744-0.118005192720895-0.118005192720895-0.344067796622985
71314.0691240284864-0.136918270649693-0.136918270649693-1.20961451838913
81212.9325956774681-0.15197898024712-0.15197898024712-1.01224113206571
91312.9873708409666-0.148955645344341-0.1489556453443410.209458126868009
101313.0113044090183-0.146480521280286-0.1464805212802860.175189117610645
111212.4648892919948-0.152108572521464-0.152108572521464-0.405306986957112
121011.1098001374771-0.168780627979749-0.168780627979750-1.21924732374979
131411.3756416220192-0.2052512394135272.257763633768310.567694259254424
141413.0383969104541-0.142189019082738-0.1421890199801941.56498830053981
151514.1774554729902-0.117448303603044-0.1174483036030451.24240554910863
161615.2141406993944-0.102989882207872-0.1029898822078721.15631406542678
171615.6652041148266-0.0977286659580146-0.09772866595801470.560046448290538
181515.3053892072666-0.0998613408926226-0.0998613408926226-0.265683953191292
191515.1465975156957-0.100304137481318-0.100304137481318-0.0598034462106509
201313.9611778528158-0.108131168628344-0.108131168628344-1.10167800158178
211514.5528627435966-0.103194633832754-0.1031946338327540.710635470163316
221514.8140578757829-0.100659380517216-0.1006593805172160.370057237879655
231514.9293247976099-0.0991719079499465-0.09917190794994640.219295115615948
241313.8649999670494-0.105766415333544-0.105766415333544-0.980238835697362
251614.2365783282754-0.1248994104210641.373893514188510.553914904181705
261615.3084776697695-0.0984727622146713-0.09847276233959941.07834052927469
271414.5807013950321-0.106359536487027-0.106359536487027-0.620875895544766
281615.3883504798348-0.0989144933689914-0.09891449336899090.920793180730677
291515.1830244920161-0.0995734487915743-0.0995734487915745-0.107816674866238
301414.5343662583743-0.102495413321234-0.102495413321234-0.557372502113621
311514.8060330623435-0.100652015435196-0.1006520154351960.380073973590501
321514.9258924724297-0.0996064964441538-0.0996064964441540.224059292236240
331414.4209063444220-0.101490727025675-0.101490727025675-0.411952916642729
341313.6400034895741-0.104612889819452-0.104612889819453-0.690468204408783
351212.7372428223082-0.108252973234636-0.108252973234636-0.811158944943769
361312.8963431083871-0.107040811397382-0.1070408113973820.271715847118304
371211.8514325660342-0.08234735403108370.905820894809686-1.04350229454497
38910.1980073566812-0.108122373080189-0.108122372716817-1.46319107171368
391010.1001729521356-0.108026935179564-0.1080269351795630.0102335043072029
4088.93777017747933-0.114389693068281-0.114389693068280-1.06500713937670
411110.1028784046752-0.108511302608257-0.1085113026082571.29787006018571
4288.9417652538594-0.112672742069584-0.112672742069583-1.06918731527649
4388.42929940350655-0.114137928063877-0.114137928063877-0.406301479613735
4488.2029902745396-0.114534033766936-0.114534033766936-0.114021241683403
4545.87107349387417-0.122219295461473-0.122219295461473-2.2541589831711
4665.95718333309146-0.121504590659857-0.1215045906598570.211793093529790
4787.11111232857776-0.117157057188541-0.1171570571885411.29666645327670
48108.73662323004881-0.111244918378391-0.1112449183783921.77169793326062
4956.22346939730925-0.06415994286130710.705759371332797-2.61528642839447
5066.10420289893826-0.0648791670129732-0.0648791668404713-0.0523032537481351
5155.49078970019951-0.068918363081794-0.0689183630817937-0.54823484984933
5297.4618682697087-0.0591414082220524-0.05914140822205092.06375593968118
5387.76930974647398-0.0578027201474461-0.0578027201474460.372095809486748
5466.78840994928271-0.0607058403524902-0.0607058403524898-0.938003378715683
5598.02977458718216-0.0569069382366746-0.05690693823667441.32363668466822
56119.69399359139506-0.0520649575285591-0.05206495752855971.74992448499083
571110.4288715210590-0.0498905100301642-0.04989051003016410.800167762386354
5889.07921757702635-0.0534478988365732-0.0534478988365732-1.32164912009629
591110.1573243834821-0.050368608791682-0.05036860879168231.15062567861942
601110.6334311280640-0.0489417030731311-0.04894170307313120.535352692433209
611311.5361672855467-0.06380146842179340.7018161514664031.02265693568257
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/1t07p1259928514.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/1t07p1259928514.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/2lj9r1259928514.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/2lj9r1259928514.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/33q6n1259928514.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/33q6n1259928514.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/435031259928514.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/435031259928514.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/5ukjq1259928514.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599285800ey7p4ktaym5bwt/5ukjq1259928514.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