Home » date » 2010 » Dec » 28 »

Paper

*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, 28 Dec 2010 19:35:27 +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/28/t1293564807jcur2lex67a98l4.htm/, Retrieved Tue, 28 Dec 2010 20:33:27 +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/28/t1293564807jcur2lex67a98l4.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 «
961 935 956 951 986 980 1031 1059 1036 1023 1030 1075 1151 1220 1290 1330 1419 1443 1516 1546 1579 1591 1603 1606 1616 1628 1594 1596 1526 1535 1581 1611 1571 1535 1498 1493 1480 1448 1462 1428 1315 1186 1230 1271 1243 1220 1214 1227 1262 1274 1272 1249 1266 1307 1345 1369 1374 1400 1425 1465 1510 1508 1512 1539 1569 1571 1650 1736 1700 1731 1752
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1961961000
2935936.438293083233-2.27637477957655-1.43829308323263-0.499108215241076
3956956.5209053369051.88090707857587-0.520905336905050.692943432588317
4951952.624393271530.522303979089565-1.62439327153079-0.172794216955631
5986986.3363405204999.23595056033624-0.3363405204988090.974877953007878
6980981.9232316196935.4538208472925-1.92323161969277-0.396897826292056
710311031.0223351320817.8752955290597-0.02233513207790171.26251599520245
810591060.3550211471521.1797372184675-1.355021147153450.330552661263599
910361038.522836210668.69191806663708-2.52283621065761-1.23930631232365
1010231024.536059720452.08557974162984-1.53605972044556-0.653029879979702
1110301030.987106577503.35937377700362-0.9871065775020660.125665013576204
1210751075.2445211722015.3030159167281-0.2445211721978511.17713119431908
1311511123.5254140601124.616035569711827.47458593989251.09031624085282
1412201220.1935428937344.5601500537191-0.1935428937346831.74420887730978
1512901289.1756603602451.6428892861240.8243396397565340.700164244363578
1613301333.0247122971249.3735462597942-3.02471229712164-0.222575238569513
1714191416.3824319009559.25835018119282.617568099051710.97174755754607
1814431447.5011931116451.0761606487051-4.50119311164243-0.80509743647965
1915161515.2079778722755.91144704277120.7920221277286520.475932948220083
2015461547.2784844449948.9798502867707-1.27848444498643-0.682380584106402
2115791580.8005376912744.4854994607685-1.80053769126774-0.442481985966224
2215911593.1115177885335.1303677775772-2.11151778853419-0.92108114172083
2316031604.8639201641128.3320520125587-1.86392016410777-0.669373640446721
2416061607.6046027514120.8967134286134-1.60460275140648-0.732125689047544
2516161610.1408085848115.62476594361425.85919141518533-0.561064670792634
2616281629.0212064012116.5433281641576-1.021206401214510.0850458557114716
2715941595.206891902562.01487705230139-1.20689190256321-1.43764506684695
2815961599.917293625842.79662476399651-3.917293625841160.0767551914209629
2915261526.13634724695-19.3957822855772-0.136347246953412-2.18190432396939
3015351537.31240326809-10.5385872992571-2.312403268092600.871616335450915
3115811576.335152449923.819212115856674.664847550078031.41333220373628
3216111610.7588876892412.68517572179940.2411123107564650.872841590170346
3315711574.92809426307-1.36985704441351-3.92809426307030-1.38378555078528
3415351537.57609053635-11.7945013977784-2.57609053635208-1.02640195154334
3514981499.49920631234-19.4097065379955-1.49920631233638-0.749814275253908
3614931492.37303268138-15.8558119902990.6269673186218190.350092537472794
3714801475.05430200280-16.27707444797914.94569799719625-0.0433772342277661
3814481446.67049618222-19.72053084541651.32950381777925-0.326431159583033
3914621461.85270255144-9.682725860785460.1472974485554040.992772385235179
4014281428.28978373195-16.5890962198329-0.289783731945483-0.678791871948481
4113151322.11398647155-42.4875884672512-7.11398647154654-2.54628934253845
4211861195.57292617751-66.7794317357355-9.57292617750833-2.39054537875425
4312301220.13881620159-40.38167953497279.861183798405542.59859029667091
4412711263.54006076648-16.16952281509107.459939233519472.38370025756123
4512431246.58987670696-16.395128349875-3.58987670695951-0.0222122520143006
4612201221.47681180011-18.91475317103-1.47681180010925-0.248084376934295
4712141215.24296723906-15.2498243490977-1.242967239059040.36084984568892
4812271224.68496850432-8.125744503854792.315031495682480.702234398576933
4912621252.253371816282.158017608796479.746628183715081.04144267450171
5012741275.682340024548.23213147249949-1.682340024544750.583172495751679
5112721273.453759755805.22911195984318-1.45375975579564-0.296713112341198
5212491245.81723425674-4.257195871336923.18276574326016-0.933210584713405
5312661262.799306509631.872617295359623.200693490367470.602682430644237
5413071318.3597588367317.3627980171068-11.35975883673401.52433229881749
5513451342.0612499901219.19156320810272.938750009876070.180024785351115
5613691362.0064092585019.40898237321076.993590741503510.0214053063621615
5713741377.1263227066618.1715075646823-3.12632270665660-0.121838533672427
5814001401.4194779404719.9378559517536-1.419477940469840.17391803019349
5914251427.1764730511121.6166500044912-2.176473051109640.165287869637088
6014651464.0630429340326.01453691087560.9369570659669780.433764151234548
6115101501.6574088987529.35018143807848.342591101247870.334575383573677
6215081510.4396804857123.4642753438675-2.43968048571409-0.56942788806412
6315121511.8172459425517.12992243671080.182754057446914-0.625238911494709
6415391536.0723218315819.18354794777382.927678168420370.202173286452353
6515691569.1765765433223.1964785388394-0.1765765433233480.394579951374799
6615711583.9901966624720.7806479673288-12.9901966624666-0.237722109364262
6716501644.2500418838932.15742274734245.749958116106391.11992954661253
6817361725.4193426019146.281433551893710.58065739809321.39054652026512
6917001709.3808046561828.3215536995056-9.38080465618261-1.76830337762832
7017311732.7382491560626.8908706126999-1.73824915605955-0.140867939939903
7117521755.6875686650025.7552284609808-3.68756866499811-0.111808362882112
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/15lft1293564923.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/15lft1293564923.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/25lft1293564923.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/25lft1293564923.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/35lft1293564923.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/35lft1293564923.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/4yuww1293564923.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293564807jcur2lex67a98l4/4yuww1293564923.ps (open in new window)


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