Home » date » 2010 » Dec » 29 »

*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: Wed, 29 Dec 2010 13:54:31 +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/29/t1293630769bkxzrmbp0e79zs4.htm/, Retrieved Wed, 29 Dec 2010 14:52:55 +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/29/t1293630769bkxzrmbp0e79zs4.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 «
1203.6 1180.59 1156.85 1191.5 1191.33 1234.18 1220.33 1228.81 1207.01 1249.48 1248.29 1280.08 1280.66 1294.87 1310.61 1270.09 1270.2 1276.66 1303.82 1335.85 1377.94 1400.63 1418.3 1438.24 1406.82 1420.86 1482.37 1530.62 1503.35 1455.27 1473.99 1526.75 1549.38 1481.14 1468.36 1378.55 1330.63 1322.7 1385.59 1400.38 1280 1267.38 1282.83 1166.36 968.75 896.24 903.25 825.88 735.09 797.87 872.81 919.14 919.32 987.48 1020.62 1057.08 1036.19 1095.63 1115.1 1073.87 1104.49 1169.43 1186.69 1089.41 1030.71 1101.6 1049.33 1141.2 1183.26 1180.55
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11203.61203.6000
21180.591181.83054196833-1.47498088467055-1.24054196832557-0.284024198566593
31156.851158.40276492714-3.12916107787666-1.55276492713600-0.462323929741867
41191.51192.014240198130.669401288963926-0.5142401981336060.760616874849795
51191.331192.706119345750.672235173313777-1.376119345753910.000459285838405934
61234.181234.702916563166.58002256633772-0.5229165631573830.835829612692212
71220.331221.972925493253.58378469172501-1.64292549324595-0.387630878363085
81228.811229.811949431794.28068175819037-1.001949431786300.0849579864893268
91207.011208.57725073455-0.0503146153421739-1.56725073455134-0.507481825158163
101249.481249.908594435267.14287248709373-0.4285944352647530.82086059574743
111248.291249.740237348875.8517222871768-1.45023734886888-0.144761539281487
121280.081280.8229019040110.3546672278062-0.7429019040067770.498938923335298
131280.661275.210635474587.646717735135335.44936452542237-0.368327514523855
141294.871294.547499385239.718380819999190.3225006147715850.196293489974706
151310.611311.5565908546011.0353690801396-0.9465908546040940.143751476310473
161270.091270.902944795471.67084497884017-0.812944795468013-1.01702690110898
171270.21270.951844940531.37662636397690-0.75184494052717-0.0319219051988098
181276.661275.838733832332.01395506064450.821266167674290.0690879403785712
191303.821304.037844682686.77107288975171-0.2178446826765580.515363787841715
201335.851334.8944560431211.14856800978610.9555439568842280.474041356286752
211377.941378.5565084674817.0595064661659-0.6165084674798320.639922229899437
221400.631400.0701146183417.86942125375790.5598853816637950.0876659464967215
231418.31419.2901788979518.1150641760275-0.9901788979490440.0265860692238078
241438.241437.8553830544218.19690306283940.3846169455814900.0088557807557456
251406.821413.6207945918510.5832916706126-6.80079459184968-0.901442063586917
261420.861420.595493041469.938276985560370.264506958542139-0.0649279143585996
271482.371479.0504895883018.73755282183573.319510411696060.954465066061165
281530.621529.9119800308424.57501852810370.7080199691557540.630843765579274
291503.351505.4337649505415.6634808200939-2.08376495053548-0.963662637039344
301455.271456.103129238393.85712254199394-0.833129238389272-1.27705335854543
311473.991472.582496715076.149891634063481.407503284926360.248027542212725
321526.751524.2785344479414.42295407070482.471465552061710.895025146735357
331549.381549.4383650303216.3731993238712-0.05836503032343990.210997924800498
341481.141483.127381893751.35429076178113-1.9873818937538-1.62496921053214
351468.361468.60415016739-1.52994286708432-0.244150167388990-0.312080844887497
361378.551379.40970929419-17.4434279596324-0.859709294190633-1.72170130499990
371330.631340.09292393723-21.3880618538749-9.46292393723279-0.451118795166033
381322.71323.57543919964-20.5138341225812-0.8754391996351940.0902442463882552
391385.591380.06514646780-6.569430566659265.524853532197831.51256578428503
401400.381397.76117241646-2.165235473370562.618827583541230.476059988298106
4112801284.23960953062-22.372626527401-4.23960953062272-2.18511249938945
421267.381266.07992115587-21.60820437400811.300078844126440.0826867743341093
431282.831280.91134873228-14.99663868075111.918651267723500.715244094821404
441166.361169.54167044699-32.4820818206898-3.1816704469876-1.89169962196002
45968.75971.730025609308-62.4784000181356-2.98002560930846-3.2453517183306
46896.24896.435677762127-64.8036881421995-0.195677762126545-0.251588995916415
47903.25896.326794186749-53.0650151784276.923205813250831.27015766709631
48825.88827.117635861972-55.9916476971527-1.23763586197186-0.316704900562764
49735.09748.617320251757-60.0573085461071-13.5273202517568-0.456862317864839
50797.87797.734431881375-40.41292405247730.1355681186246342.05604575055323
51872.81864.005074905056-21.11512383931688.804925094944282.09256909221330
52919.14908.016106417033-9.3061982335959411.12389358296661.27685535300450
53919.32922.265054996798-5.03549660036184-2.945054996798040.461805437371435
54987.48985.3269414975817.309651350079472.153058502418621.33538037188976
551020.621014.8190765513911.33088893629815.800923448613960.435030050251917
561057.081050.5177329662515.74819214271916.562267033747150.477902688790586
571036.191038.4751565802710.7104055367327-2.28515658026792-0.545053910784206
581095.631095.2195383743719.05548645263380.4104616256316160.902929730448005
591115.11106.9115197725417.72060588433248.18848022746418-0.144434962164476
601073.871075.521339332238.82681568371132-1.65133933223487-0.962748007605339
611104.491125.3589070086716.2394810504188-20.86890700866780.824107489298788
621169.431172.9618960739721.8911302851220-3.531896073973730.59671510432668
631186.691181.9974596278319.56747693963984.69254037216617-0.251846304781234
641089.411084.97465089641-1.556932449785124.43534910359214-2.28483253462047
651030.711037.89762562787-9.80451386639556-7.18762562786593-0.891833279370407
661101.61095.786272625002.459168660985185.813727374998191.32656148890715
671049.331048.34263486264-6.581181105204950.987365137363155-0.978023875229743
681141.21127.558622082728.9615078688042813.64137791727891.68156261293303
691183.261186.4260945833318.0022741912657-3.166094583331720.97816078291961
701180.551182.2247556223913.9798161313664-1.67475562239472-0.435232562037672
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/16k9g1293630865.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/16k9g1293630865.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/26k9g1293630865.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/26k9g1293630865.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/3zc8j1293630865.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/3zc8j1293630865.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/4r3qm1293630865.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t1293630769bkxzrmbp0e79zs4/4r3qm1293630865.ps (open in new window)


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