Home » date » 2009 » Dec » 01 »

*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 11:53:41 -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/t1259693682902t41val1f8nj6.htm/, Retrieved Tue, 01 Dec 2009 19:54:49 +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/t1259693682902t41val1f8nj6.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 «
785.8 819.3 849.4 880.4 900.1 937.2 948.9 952.6 947.3 974.2 1000.8 1032.8 1050.7 1057.3 1075.4 1118.4 1179.8 1227 1257.8 1251.5 1236.3 1170.6 1213.1 1265.5 1300.8 1348.4 1371.9 1403.3 1451.8 1474.2 1438.2 1513.6 1562.2 1546.2 1527.5 1418.7 1448.5 1492.1 1395.4 1403.7 1316.6 1274.5 1264.4 1323.9 1332.1 1250.2 1096.7 1080.8 1039.2 792 746.6 688.8 715.8 672.9 629.5 681.2 755.4 760.6 765.9 836.8 904.9
 
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
1785.8785.8000
2819.3817.6092824164342.676916696348911.690717583565650.39719223433328
3849.4847.7204224410746.84577195599121.679577558925500.533925998333214
4880.4878.72829966682411.60892420816241.671700333175980.457582594189363
5900.1898.43034386402713.43180267078521.669656135973120.150572765794228
6937.2935.53487770315819.15474697706081.665122296842470.435741924222337
7948.9947.23380835902817.28234360600881.66619164097247-0.136394450123664
8952.6950.9323595663913.80000637152001.66764043360883-0.247639628313144
9947.3945.6308504242268.848116796426491.66914957577367-0.347566601463131
10974.2972.53190471565313.55667594070041.668095284347520.3281445814981
111000.8999.1324671386816.97003001352441.667532861320710.236961926540982
121032.81031.1329453218620.910307927241.667054678140300.272967387597524
131050.71064.1952809305323.9861078329843-13.49528093052950.256142096431306
141057.31056.7748259859516.1401042369040.525174014053045-0.476856585731127
151075.41074.8771781486716.65627503912620.5228218513321310.0355656476534347
161118.41117.9004757050023.58654484980810.4995242950046110.478147592285431
171179.81179.3251247313233.52809958151710.4748752686835730.686401833691654
1812271226.5316945576237.12139368635460.4683054423792230.248191353229814
191257.81257.3294551283435.46028365333930.470544871660763-0.114758419392082
201251.51251.0185481954624.48776238966780.481451804534982-0.758128365479101
211236.31235.8109059893314.06035206556340.489094010668068-0.720510051317063
221170.61170.09958259550-6.894969642885940.500417404495105-1.44801390892128
231213.11212.604752733396.082294818635660.4952472666087150.896746339175407
241265.51265.0083270878218.25098262829070.4916729121800660.840881089688386
251300.81302.5884356890223.2522482701005-1.788435689023270.378965520562840
261348.41347.9203538703328.86688346495750.4796461296703250.360460365295743
271371.91371.4160879406327.45422628413260.483912059369256-0.0974010858232042
281403.31402.8183995005128.49192552566970.4816004994886140.0716210713320114
291451.81451.3270397124833.75137870053420.4729602875186440.363203749207738
301474.21473.7234260017230.76824307078370.4765739982753-0.206069355466187
311438.21437.7077555365413.22402391216240.49224446345753-1.21211965582312
321513.61513.1185140779929.56033268923450.4814859220084651.12876620314203
331562.21561.7209430098734.56266871683230.47905699012920.345655853288744
341546.21545.7161873081021.27851751415300.483812691902991-0.917944182211116
351527.51527.0134149978510.77523025296520.486585002153875-0.725794894781744
361418.71418.20730152607-20.63975948654040.492698473930562-2.17084571764114
371448.51447.77614094509-7.579105632858720.723859054906750.960074783422643
381492.11491.62137160545.611236071232620.478628394600270.865517533559587
391395.41394.86114539285-21.30567049562630.538854607147992-1.85696181010308
401403.71403.17399088462-13.5217474572780.5260091153775990.537408060928477
411316.61316.05045698711-32.86020694761790.549543012891735-1.33569010807091
421274.51273.94827825169-35.28822797033130.551721748310102-0.167738647801777
431264.41263.85265703700-28.66997861051550.5473429629966840.457273961923214
441323.91323.36395757756-5.504463864090720.5360424224421381.60067779808003
451332.11331.56525257134-1.903903760925050.5347474286584380.248798403139152
461250.21249.65967937765-22.92085086609660.540320622345836-1.45229757317388
471096.71096.15297219280-57.22690508408870.547027807197017-2.37061674091869
481080.81080.25453725348-46.3694586072510.5454627465226890.750275514409668
491039.21044.25763222343-43.6643470865065-5.057632223426390.195832418939757
50792793.278437919647-97.1088401705711-1.27843791964651-3.54866067243658
51746.6747.902599241084-83.5087750771732-1.302599241084360.938570404677832
52688.8690.111454041365-76.750486622232-1.311454041364970.466683921680099
53715.8717.137797289207-49.4842359072828-1.337797289206991.88344525119048
54672.9674.239029796824-47.7541191975249-1.339029796824440.119530812847165
55629.5630.839630696876-46.6100959362039-1.339630696875650.0790462235088793
56681.2682.549633566706-20.7807519469652-1.349633566706121.78477045555338
57755.4756.7567586575654.17325989438115-1.356758657565371.72433530226900
58760.6761.9568154441394.44300874407886-1.356815444139150.0186400750996998
59765.9767.2568503897774.66815896021728-1.356850389776920.0155583692333735
60836.8838.15884159236422.0686346454974-1.358841592363991.20241617704689
61904.9887.94957714185729.309345540591716.95042285814310.519368014977001
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/10y1f1259693618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/10y1f1259693618.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/24fsv1259693618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/24fsv1259693618.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/30pvs1259693618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/30pvs1259693618.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/52uys1259693618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259693682902t41val1f8nj6/52uys1259693618.ps (open in new window)


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