Home » date » 2010 » Dec » 14 »

paper - STSM

*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: Tue, 14 Dec 2010 09:54:17 +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/14/t129232039447lvhkh119whqk8.htm/, Retrieved Tue, 14 Dec 2010 10:53:16 +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/14/t129232039447lvhkh119whqk8.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 «
235.1 280.7 264.6 240.7 201.4 240.8 241.1 223.8 206.1 174.7 203.3 220.5 299.5 347.4 338.3 327.7 351.6 396.6 438.8 395.6 363.5 378.8 357 369 464.8 479.1 431.3 366.5 326.3 355.1 331.6 261.3 249 205.5 235.6 240.9 264.9 253.8 232.3 193.8 177 213.2 207.2 180.6 188.6 175.4 199 179.6 225.8 234 200.2 183.6 178.2 203.2 208.5 191.8 172.8 148 159.4 154.5 213.2 196.4 182.8 176.4 153.6 173.2 171 151.2 161.9 157.2 201.7 236.4 356.1 398.3 403.7 384.6 365.8 368.1 367.9 347 343.3 292.9 311.5 300.9 366.9 356.9 329.7 316.2 269 289.3 266.2 253.6 233.8 228.4 253.6 260.1 306.6 309.2 309.5 271 279.9 317.9 298.4 246.7 227.3 209.1
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1235.1235.1000
2280.7277.8786495365732.330226086782832.821350463427140.970748348648947
3264.6263.7432012746972.180849669229260.85679872530267-0.619229234750829
4240.7239.8433781505052.08156342882720.856621849495357-0.981939970825554
5201.4201.3762891672571.909251153853910.0237108327428216-1.52650067638383
6240.8235.9744973263262.051922029517724.825502673673661.23060003543256
7241.1239.6119008093752.058813813329221.488099190625340.0596862597994536
8223.8222.9690366730381.977918601451710.83096332696227-0.704028345304963
9206.1205.0153352901251.892078656004551.08466470987538-0.750323320077933
10174.7174.4744962189741.752997078053280.225503781025959-1.22092274127319
11203.3199.4064874856461.851970917035773.893512514354430.872555580311552
12220.5218.0476602853451.923355658002832.452339714654740.632011451096794
13299.5287.629602259823-0.86760248960761611.87039774017723.03148776271513
14347.4342.9654726255570.3790120233824874.434527374443391.83263819796448
15338.3340.4690155858030.356887296458952-2.16901558580277-0.107635272395743
16327.7327.2272781252380.3271819550377260.472721874762107-0.511563789044118
17351.6352.0077238833460.377447255130508-0.4077238833457280.9196677598882
18396.6390.6451020985020.4646426184647075.954897901497761.43887172529361
19438.8434.955306077450.5661958061265853.844693922549841.64893554230362
20395.6400.6445056992010.485738158637949-5.04450569920147-1.31164670295768
21363.5364.3865115302680.401243320369816-0.886511530267548-1.38184677146244
22378.8378.1383588935040.4325660810183950.6616411064962410.502108429645941
23357356.834552976950.3775873474382910.16544702304971-0.817690266447621
24369369.9853315609090.384746367573487-0.9853315609091660.479963011744462
25464.8448.359782102865-0.95261110717052516.44021789713463.16072755887902
26479.1473.976014820179-0.6174555350889525.123985179821180.929711541026138
27431.3438.537263291325-0.866908056398829-7.23726329132483-1.29881299324509
28366.5375.533102786943-1.00552791824276-9.0331027869426-2.33722465655691
29326.3333.857846689265-1.066383287159-7.55784668926473-1.52925385263982
30355.1351.448844508518-1.035029901686873.651155491482180.701489228820092
31331.6329.787635939933-1.071667224250511.8123640600669-0.775501364074007
32261.3271.108918949166-1.1744235245023-9.80891894916622-2.16590539741366
33249253.018497675771-1.20483220310683-4.01849767577088-0.636017003299866
34205.5208.403384406243-1.28805219859473-2.90338440624275-1.63238768937127
35235.6231.999772538107-1.240678041787063.600227461893210.935879152931365
36240.9247.823166255779-1.25510060519951-6.923166255778770.641295741386453
37264.9250.284097820484-1.2905106145606114.6159021795160.145382946982042
38253.8245.692123336567-1.317269647787248.10787666343303-0.119002213600224
39232.3234.817945248688-1.37958959139681-2.51794524868753-0.355772478318949
40193.8202.73398965515-1.45637101285456-8.93398965515026-1.15465544133388
41177188.624602298952-1.47351848902422-11.6246022989522-0.475763129355498
42213.2205.590093773085-1.447805999335437.60990622691510.693221143161009
43207.2200.916254522455-1.452701841901746.28374547754533-0.121278642607948
44180.6190.481928935706-1.46672383207795-9.88192893570593-0.337652686755762
45188.6187.405599926681-1.469327691938191.19440007331936-0.0605145835274915
46175.4181.478623112595-1.47708960647708-6.0786231125948-0.167622094603992
47199195.241497517955-1.455656899795543.758502482045360.572988137806708
48179.6188.219680779707-1.44789933366152-8.61968077970726-0.209318719590888
49225.8206.751333517532-1.5644960173782619.04866648246820.76848762703954
50234223.065580606754-1.4639301160363410.93441939324610.654219739057499
51200.2202.505629378843-1.5752420285696-2.30562937884331-0.710437435101487
52183.6191.981438357092-1.59960093301114-8.38143835709222-0.336396421379105
53178.2191.742035793182-1.59772695531059-13.54203579318170.0511454674329914
54203.2194.723135870074-1.59203102057658.476864129925870.172138421528538
55208.5200.365893371415-1.582217278278318.13410662858470.271968796776699
56191.8201.385859883033-1.57846597785625-9.585859883033330.0978210181111924
57172.8174.801385503025-1.61687907579335-2.0013855030251-0.94011818207454
58148157.444426450243-1.64202614145225-9.44442645024321-0.591867426850214
59159.4154.281024677452-1.643539550166275.11897532254839-0.05718434529103
60154.5163.548671082677-1.66014566532345-9.048671082676930.410530171528305
61213.2191.453647226868-1.7706570822421.74635277313161.12670176747893
62196.4184.13384785248-1.7937132976556612.2661521475203-0.204759501229022
63182.8183.950128304675-1.78538970014308-1.150128304674510.0599079372382813
64176.4184.777272933263-1.77795238124193-8.377272933262920.098158498217201
65153.6169.995333661313-1.79693020877862-16.3953336613133-0.488973239178999
66173.2166.174348658389-1.799305208803727.02565134161057-0.0760932744058476
67171163.703920548511-1.800144337291327.29607945148886-0.0252282899401596
68151.2158.363313219096-1.8049783523128-7.16331321909565-0.133091170537747
69161.9161.084654800455-1.798295054578640.8153451995446750.170172419764591
70157.2165.404042147141-1.7894361735729-8.20404214714060.230027221234123
71201.7193.64076153313-1.769050735404388.059238466869761.12837708005752
72236.4242.357316357528-1.84218716255518-5.95731635752821.89996872062642
73356.1321.962822594572-2.0412457125970234.13717740542813.0871749406237
74398.3380.247061482248-1.845773932211218.05293851775242.23698639182873
75403.7404.093269659919-1.72805764323721-0.3932696599186390.956553297653652
76384.6394.192245057296-1.75164779243467-9.59224505729585-0.306924442566173
77365.8383.64743087803-1.7652989272544-17.8474308780302-0.330630189545905
78368.1363.499426790646-1.786498707633944.60057320935429-0.691096792250607
79367.9359.562989573822-1.78904238862938.33701042617826-0.0808190585594544
80347354.186281296983-1.79373729535243-7.18628129698305-0.134867054357131
81343.3343.178264442168-1.806762762562050.1217355578317-0.346425836382056
82292.9308.174409905557-1.84979303894569-15.2744099055567-1.24811184619951
83311.5307.705355012032-1.849169794518243.794644987967830.051881815665856
84300.9315.245207649637-1.8612639467077-14.34520764963720.35335393291527
85366.9337.609473280529-1.90008085334729.29052671947150.915205323162074
86356.9342.01444749463-1.8833833259405314.88555250537010.234522439617019
87329.7331.051109104116-1.92038162825464-1.35110910411592-0.338309090180236
88316.2325.503761752541-1.93076967531457-9.30376175254145-0.136146005445651
89269289.897988238813-1.98587549698718-20.8979882388133-1.26612605691273
90289.3284.622530832517-1.98970402171294.67746916748271-0.12367364430659
91266.2260.825155134065-2.014651270455575.37484486593492-0.819794525928847
92253.6259.007992389454-2.01440222402308-5.407992389454140.00742412733846554
93233.8232.74850371286-2.046957961231121.05149628713982-0.911534056284188
94228.4241.458219853056-2.03457831649602-13.05821985305560.404377419767221
95253.6249.498750452866-2.031601728750144.101249547133870.378554512134653
96260.1273.67771583308-2.06040113380946-13.577715833080.986316516776123
97306.6277.599488427056-2.0665767863473629.00051157294390.225522500113115
98309.2291.290720004724-2.0311064177211617.90927999527630.587299970662815
99309.5308.27352349758-1.961799043299621.226476502420310.708971826909975
100271280.763372675471-2.03337485435866-9.76337267547105-0.958668298741562
101279.9297.412273662904-2.001546887085-17.5122736629040.70235667542396
102317.9308.755261491531-1.98564894683859.144738508468490.501702270033072
103298.4294.937184155733-1.998948547818843.46281584426708-0.444816503816065
104246.7254.435782600903-2.04585833959804-7.73578260090311-1.44744849988057
105227.3229.938047964283-2.07429386159314-2.63804796428298-0.844105406239112
106209.1223.194361511141-2.07904842165478-14.0943615111413-0.175519482986977
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/1wcdb1292320452.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/1wcdb1292320452.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/26lvw1292320452.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/26lvw1292320452.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/3huuz1292320452.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/3huuz1292320452.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/4huuz1292320452.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t129232039447lvhkh119whqk8/4huuz1292320452.ps (open in new window)


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