Home » date » 2009 » Dec » 01 »

structural timeseries

*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, 01 Dec 2009 12:02:53 -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/01/t1259694235mxcdj199k0vidb7.htm/, Retrieved Tue, 01 Dec 2009 20:04:01 +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/01/t1259694235mxcdj199k0vidb7.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 «
7291 6820 8031 7862 7357 7213 7079 7012 7319 8148 7599 6908 7878 7407 7911 7323 7179 6758 6934 6696 7688 8296 7697 7907 7592 7710 9011 8225 7733 8062 7859 8221 8330 8868 9053 8811 8120 7953 8878 8601 8361 9116 9310 9891 10147 10317 10682 10276 10614 9413 11068 9772 10350 10541 10049 10714 10759 11684 11462 10485 11056 10184 11082 10554 11315 10847 11104 11026 11073 12073 12328 11172
 
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
172917291000
268207048.68374732168-13.2611654876782-134.840613763128-1.04355479152437
380317493.267503562718.1125206526509390.7003754343121.83592902788528
478627713.328543094528.806650562373568.17159742720990.950525852620733
573577594.138404824523.0798460388473-171.851574428151-0.745883741957134
672137412.8440314866316.7059932940849-106.718099601164-1.05098366565339
770797240.4164814554411.3340005639096-74.4966734139742-0.977067469653487
870127113.35521884077.46874033390386-37.6958479907924-0.714894154450486
973197177.859611797829.0861735775606114.9433701051030.294204356472167
1081487600.4394290829721.1005217792702358.0319491264912.12923293199540
1175997671.1261766735722.5774335036598-94.80644672022980.254901740865258
1269087357.7368768881112.3387736497183-296.377822956583-1.72426220584337
1378787511.470763791668.51365443585555298.7874230216760.832768070543478
1474077659.6698682651311.8478622837356-311.0320259443860.699422629064606
1579117671.2338199182211.8358006325896239.871423136174-0.00130998792483277
1673237480.772062483462.98974315981812-80.5380609496657-0.963915941973353
1771797361.8263009821-1.85757745151146-133.962787909043-0.603078425928941
1867587105.35278873495-10.9982549616414-242.668769655792-1.28167187919449
1969347000.51920549942-14.1551460848484-27.5727771673630-0.475030151478542
2066966900.20396845968-16.9797170770225-168.358073091576-0.436603798980192
2176887226.20463333312-5.76111259305233319.1319131665341.73702942415039
2282967567.812890729125.61695542044239583.8339633194581.75729814634966
2376977675.534183683658.88622142500431-20.92764201113280.515692754377049
2479077951.3612273672316.5890703596405-155.2889794361461.34838690870133
2575927772.5754841477212.6707867788182-97.8375403304805-1.01798928366606
2677107835.4911996850814.1875247848437-146.0813910912290.252633678064310
2790118181.0579411025426.9001528930008701.2006283544531.59972023941562
2882258249.253057370428.5902851500672-40.20751049020410.199606300425917
2977338054.8238194369319.5965575902860-234.012742509691-1.09639231246194
3080628106.6070978511620.8452406792173-57.48650555594690.160177160475840
3178598035.2761175736817.3915861949327-139.097928536477-0.461110355506568
3282218256.7618699381724.8676813862013-118.3056011051741.02230583362258
3383308277.292730655624.711005942631954.4618614152546-0.0217149244208512
3488688326.5354665345825.5848595513574531.5467017031020.122682031477188
3590538685.6374622203237.171791607188232.6744748672621.66557172067662
3688118842.1500822278641.1452234701889-79.37670227883190.596870614182408
3781208678.0494611536534.5785186295075-474.561646742321-1.03559255897059
3879538507.4309124312227.4212054571413-471.798870485392-1.02413989936943
3988788350.2586709003320.3902199643988600.399169125844-0.904397560154914
4086018403.5397175784721.6954792645921184.6176849751620.160550046591718
4183618495.061950536924.4795444720377-161.5102873685060.343326489198481
4291168780.5539695329934.7536852443553231.8905599134011.29321068413719
4393109143.9212101419747.469967646299934.95614722125681.63466389998092
4498919572.8559108547362.0073688716162165.6155066386691.89931762784982
45101479905.7268614521872.1962862258242132.9773774505951.34762897451159
461031710016.546327816373.6304710877073285.0284096398670.191897580410769
471068210249.386663283179.4557132360774369.0911169095030.79040497743052
481027610306.330706658278.64376581864-21.3410179580736-0.111945866857702
491061410610.389371701186.7552629680137-86.6697376372481.12474976872109
50941310373.687158491974.7790798188108-831.620064995144-1.60719749047823
511106810428.398548449574.0102312779966647.526101810366-0.098833694891011
52977210169.496444553160.9846697124375-266.778910394404-1.63410867673940
531035010377.953641369266.789656224051-85.98596968083950.72612670344276
541054110505.521100566369.17320396640511.43735401064500.300654683936889
551004910455.982789178764.5548874606687-359.844378799897-0.588897114626286
561071410576.959152581466.7301718431311114.6068202348710.280032877243103
571075910665.792171460267.57486984407484.42375025832550.109597200580330
581168411037.519886117679.1010212184423525.7512211869441.50623759587080
591146211154.641852674780.5308555217278292.2766583634250.188225193229656
601048510971.811347249770.6750543478657-382.248618588742-1.30565169501504
611105610973.861862325568.102014984308109.431398351198-0.340815452641316
621018410996.624736520466.3824462910915-794.619894168715-0.224752029060345
631108210748.352202884254.2780137671281457.965437368703-1.55274557482400
641055410796.133494028654.0255517929649-239.575872566221-0.0319850409632741
651131511072.329958213862.6939124156583155.1524188655761.09528742526485
661084711027.843152658858.5156672325497-138.498157362335-0.529881669715866
671110411242.885045946064.5950269826568-200.8795181522560.775309707590191
681102611197.467035501260.3431224231802-127.859921089333-0.545048847437742
691107311193.467325927757.8691224108759-94.97905511919-0.318490297321043
701207311347.072894904161.532449989892688.0440193109760.473401533514601
711232811610.550698181969.2300751248162637.5741314236620.998473944486447
721117211632.871801660867.445216111687-442.303003545541-0.232186314431388
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/12xjt1259694170.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/12xjt1259694170.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/2dpqd1259694170.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/2dpqd1259694170.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/3uivy1259694170.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/3uivy1259694170.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/4psd31259694170.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/4psd31259694170.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/57s9s1259694170.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694235mxcdj199k0vidb7/57s9s1259694170.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
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