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 05:57:06 -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/t1259672261b01yyua39rsv6kk.htm/, Retrieved Tue, 01 Dec 2009 13:57: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/2009/Dec/01/t1259672261b01yyua39rsv6kk.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 «
149 139 135 130 127 122 117 112 113 149 157 157 147 137 132 125 123 117 114 111 112 144 150 149 134 123 116 117 111 105 102 95 93 124 130 124 115 106 105 105 101 95 93 84 87 116 120 117 109 105 107 109 109 108 107 99 103 131 137 135
 
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
1149149000
2139140.642680576515-8.49307815026848-1.64268057651493-1.53765266125616
3135133.500074333951-7.484795962701341.499925666049080.179646588980101
4130129.283276243248-4.925184883095340.7167237567524830.429256154743507
5127126.651382555049-3.166310018431370.3486174449509740.291079352906523
6122122.311849936321-4.06655159085912-0.311849936321065-0.149789544700316
7117117.091867312654-4.95319531857533-0.0918673126539773-0.147350847235532
8112111.898546268554-5.137800748278450.101453731446092-0.030678983366815
9113111.824958833281-1.245114312629271.175041166719070.646919143568898
10149142.44671925255123.24742380852756.553280747448914.07033839229334
11157160.10421869560618.9510630761748-3.10421869560569-0.713999477056228
12157160.5196668679784.70448911649624-3.51966686797777-2.36759559411703
13147149.423130932804-7.41655389196125-2.42313093280427-2.01924575973931
14137138.651364472095-9.99854288348633-1.65136447209467-0.435433688410373
15132130.534993534140-8.610431846345181.465006465860460.230491923985758
16125124.486759690037-6.70924648256850.5132403099631740.320020400182524
17123121.875694581931-3.669063826847661.124305418069350.503847616814496
18117117.154745667397-4.44511553052076-0.154745667396741-0.128904542228427
19114112.241921807902-4.790630408280971.75807819209767-0.0574491052755323
20111109.914705067346-2.969364295436931.085294932654010.302662382626359
21112116.9762422998244.44713746808584-4.976242299824131.23251262198667
22144135.03976506988814.51411010455578.960234930111661.67305690975416
23150150.23711739365715.0191564854999-0.2371173936565920.0839323489125045
24149152.1177354974485.3147578699753-3.11773549744823-1.61305750864612
25134139.248256960133-8.11523536092009-5.24825696013339-2.2378636708975
26123125.537574114383-12.2528618936276-2.53757411438341-0.68856124472217
27116114.622774908123-11.27519938775731.377225091876970.162261823446907
28117114.934190035589-2.808870452216212.065809964411281.41518045008513
29111110.122835175705-4.276669184022110.877164824294993-0.24393608941861
30105104.312497403644-5.396705631594060.687502596355746-0.185893147778276
3110299.421513904895-5.027526349847932.578486095105020.0613714544182754
329595.7214539580626-4.05752352454881-0.7214539580626080.161219869519527
3393100.4143621895542.33841008833955-7.41436218955441.06288312950126
34124114.35518157542610.81852104459499.644818424574431.40936625470719
35130127.55530123620812.55850167639592.444698763792050.289158446775954
36124125.7345792329272.06014739807857-1.73457923292679-1.74557285435788
37115119.776311469382-3.79779900091381-4.77631146938185-0.975257794511677
38106110.058781352843-8.12081463749695-4.05878135284279-0.718291414599892
39105105.904108687892-5.24063090231314-0.9041086878923760.478301449981572
40105102.157704601022-4.155874988942872.842295398978260.180798076324648
4110199.0789740558476-3.371940828325951.921025944152430.130375755907062
429593.937052234357-4.657855302292021.06294776564306-0.213476291706792
439389.62050641417-4.410142668126713.379493585830020.0411638873681076
448486.587003679845-3.41035569721649-2.587003679844960.166174772278906
458795.63734446383235.64313017181864-8.637344463832281.50454521176173
46116106.9758773311379.781082349591739.024122668863240.687688851854283
47120114.6922320255808.281584838502225.3077679744197-0.249204179611138
48117117.6759763261694.43523333482768-0.675976326169283-0.639585710530923
49109113.874904078211-1.54813087197722-4.87490407821138-0.995393229057181
50105110.472914701071-2.89384823860998-5.47291470107083-0.223548606989907
51107108.300245479617-2.37204396861045-1.300245479616670.0866803898783519
52109106.305202687956-2.099331418256182.694797312044120.0453975352294533
53109105.741816728978-0.986298992555223.258183271021780.185116680497438
54108105.870806544331-0.1786821185696572.129193455668750.134123914864716
55107103.829194688776-1.526328525335773.17080531122411-0.223899932731448
5699104.5464545304910.0971454867296635-5.54645453049080.269819606800327
57103112.1310423146815.51737273017742-9.131042314680780.900777278002992
58131121.3663701100878.208855791410829.633629889913440.447291391219030
59137130.3809431068258.79195569536496.619056893174950.0969124558026854
60135134.4981385315395.408949236581990.50186146846088-0.562506573840623
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259672261b01yyua39rsv6kk/12n6r1259672224.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259672261b01yyua39rsv6kk/12n6r1259672224.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259672261b01yyua39rsv6kk/5aqay1259672224.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259672261b01yyua39rsv6kk/5aqay1259672224.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