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 12:05:11 -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/t1259953542lbcne2lg2kfz3oe.htm/, Retrieved Fri, 04 Dec 2009 20:05:48 +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/t1259953542lbcne2lg2kfz3oe.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 «
14.9 18.6 19.1 18.8 18.2 18 19 20.7 21.2 20.7 19.6 18.6 18.7 23.8 24.9 24.8 23.8 22.3 21.7 20.7 19.7 18.4 17.4 17 18 23.8 25.5 25.6 23.7 22 21.3 20.7 20.4 20.3 20.4 19.8 19.5 23.1 23.5 23.5 22.9 21.9 21.5 20.5 20.2 19.4 19.2 18.8 18.8 22.6 23.3 23 21.4 19.9 18.8 18.6 18.4 18.6 19.9 19.2 18.4
 
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'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
114.914.9000
218.618.49636633637121.959522008949630.1036336636288482.67574541083026
319.119.00179993658950.7891890667212250.0982000634105242-1.09926465742992
418.818.6893326054695-0.08197203010778480.110667394530525-0.88351553292114
518.218.0852634657129-0.4954024087138590.114736534287079-0.421087081668346
61817.8804873802303-0.2651803929172770.1195126197696780.234513407124899
71918.87503957465050.7328057231108060.1249604253494991.01659379848851
820.720.57900404500881.502191784235420.1209959549912070.783731637440376
921.221.09268287475930.7190539880751380.107317125240685-0.797739789429887
1020.720.5906039300775-0.2483750699643520.109396069922484-0.985467253946108
1119.619.4874950900653-0.925528564890050.112504909934693-0.689779358614831
1218.618.4825677346654-0.9884313919602320.117432265334611-0.0640756815651315
1318.719.58024503294320.63599789298586-0.8802450329432041.81717330558587
1423.823.63367046622592.961769532732860.1663295337741432.25596283857556
1524.924.78995533015261.531090069446190.110044669847427-1.4191781479967
1624.824.66723427672330.2306954318525040.132765723276674-1.32112552682345
1723.823.6597219728002-0.7438697023914680.140278027199789-0.992692153068098
1822.322.1596515174833-1.339164822299580.140348482516665-0.606393989794981
1921.721.5433064816194-0.7701366503384260.1566935183805790.579637914084658
2020.720.5478414789925-0.9475240771017230.152158521007479-0.180694901995688
2119.719.5526192416813-0.9850740145220.147380758318688-0.0382500747013373
2218.418.2556005298177-1.230650061156130.144399470182251-0.250154934121929
2317.417.2348323352030-1.065412435206250.1651676647970270.168318936995219
241716.8570602808589-0.5242304970442360.1429397191411270.551288476205146
251819.35464240978771.83813004492188-1.354642409787692.52028624841156
2623.823.59061285656513.562457804464020.2093871434348751.71548337349918
2725.525.40346663232822.186121325550860.0965333676718153-1.38271892324709
2825.625.47615489452880.5326958906039110.123845105471156-1.67984582071548
2923.723.5659805432428-1.380120507871080.134019456757183-1.94841302878142
302221.8612771969591-1.634321206657320.138722803040948-0.258940390083650
3121.321.1122099702114-0.9410267745205320.1877900297886230.706221206934525
3220.720.5393365378003-0.652703791446250.1606634621996730.293698904322016
3320.420.2341127210846-0.3805713428527560.1658872789154450.277206496272518
3420.320.1436842126631-0.1533403352038590.1563157873368670.231467846116482
3520.420.20303177991400.01324440590738850.1969682200860330.169692280945363
3619.819.7046967814650-0.3871763086747550.0953032185349647-0.407945161905656
3719.521.12972659548151.02794309669007-1.629726595481541.48271640034508
3823.122.86846193665771.551894712479670.2315380633423160.52597406976628
3923.523.40663476298930.7588025225386380.0933652370107018-0.80197510590265
4023.523.33315674441070.1102181773372890.166843255589294-0.658890555859676
4122.922.7583142710786-0.424027204318890.141685728921434-0.54418400017232
4221.921.7890760967952-0.8493070980783930.110923903204748-0.433209393622026
4321.521.3069770570496-0.562878539573460.1930229429503860.29176916548235
4420.520.3555221305564-0.8659727749560120.144477869443552-0.308745570150847
4520.220.0275731302723-0.446307785741070.1724268697276900.427489865582739
4619.419.2670945002758-0.6913718281482990.132905499724190-0.249633473705347
4719.218.9559171978162-0.3947851201921520.2440828021837890.302121020156532
4818.818.7431486512696-0.2529249548820530.05685134873035110.144553995138398
4918.820.43097652591201.2595856319138-1.630976525911961.56953414634139
5022.622.34426381885451.748049110479230.2557361811455200.492583844589775
5123.323.22001287066811.068461139279520.0799871293318805-0.689780782450303
522322.8526861167906-0.04719809323281690.147313883209369-1.13333102016186
5321.421.2679155967925-1.242583921271000.132084403207512-1.21760144990606
5419.919.8029482758241-1.415526052623460.0970517241758727-0.176166552709623
5518.818.5801599358129-1.265640784209190.219840064187060.152679956194470
5618.618.4499206974265-0.3826936950038750.1500793025734510.899410046192465
5718.418.2165947665365-0.2665373589246060.1834052334634660.118322133278772
5818.618.46512285912480.1340232375651580.1348771408752490.408029936691651
5919.919.60742422640060.9181778335914120.2925757735993690.798786383587909
6019.219.2338836305732-0.085342739094769-0.0338836305732321-1.02281489359146
6118.420.08257647863280.641142144687673-1.682576478632810.749424269891704
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953542lbcne2lg2kfz3oe/1m21n1259953504.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953542lbcne2lg2kfz3oe/1m21n1259953504.ps (open in new window)


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


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


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


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


 
Parameters (Session):
par1 = 36 ; par2 = -1.8 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = MA ; par7 = 0.95 ;
 
Parameters (R input):
par1 = 12 ; par2 = -1.8 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = MA ; par7 = 0.95 ;
 
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