Home » date » 2010 » Dec » 17 »

Structural Time Series Decomp Passengers

*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: Fri, 17 Dec 2010 16:42:30 +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/17/t12926040327vcnf0lrbl0ks1a.htm/, Retrieved Fri, 17 Dec 2010 17:40:33 +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/17/t12926040327vcnf0lrbl0ks1a.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 «
989236 1008380 1207763 1368839 1469798 1498721 1761769 1653214 1599104 1421179 1163995 1037735 1015407 1039210 1258049 1469445 1552346 1549144 1785895 1662335 1629440 1467430 1202209 1076982 1039367 1063449 1335135 1491602 1591972 1641248 1898849 1798580 1762444 1622044 1368955 1262973 1195650 1269530 1479279 1607819 1712466 1721766 1949843 1821326 1757802 1590367 1260647 1149235 1016367 1027885 1262159 1520854 1544144 1564709 1821776 1741365 1623386 1498658 1241822 1136029
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1989236989236000
210083801007464.8239676318304.4583479359915.1760323714560.205158156588241
312077631190887.15417499164849.20203265816875.84582501491.68381616733103
413688391371096.55868827178472.562432723-2257.558688265920.14847010537782
514697981475942.25957356113401.039471187-6144.2595735563-0.712754757498346
614987211503786.8173673137693.4894229754-5065.81736731116-0.828882468346857
717617691741127.72496455214372.61100493420641.27503545321.93433688951141
816532141681601.15695943-27997.9408651255-28387.1569594327-2.65354152616664
915991041596784.5114017-78275.31559761832319.48859830071-0.550450693824062
1014211791427148.81367717-159118.311904447-5969.81367716915-0.885091652012392
1111639951169751.58806709-246083.610723971-5756.5880670883-0.952120316062697
1210377351025502.96921664-155971.64956547512232.03078335750.98657085251419
1310154071006998.77809958-34428.921999068408.221900424871.33218656308679
1410392101050488.3929653934586.3292676019-11278.3929653890.763051783989928
1512580491233257.84531859160152.95891237824791.15468141071.38987413167301
1614694451459806.03739443216956.5956768249638.962605572710.622455115941462
1715523461555364.24688723113678.637191466-3018.24688723112-1.12989323953066
1815491441596435.2106385251863.3106968983-47291.2106385222-0.676935426438004
1917858951725616.81096116117714.65126857160278.18903884380.72094603575268
2016623351706520.011008871195.99598397061-44185.0110088708-1.27568394604374
2116294401628079.48332224-66624.21406145891360.51667775942-0.742514535171335
2214674301465088.59365848-148692.7052420632341.40634152317-0.898509045970153
2312022091221073.46751818-229874.489388055-18864.4675181832-0.888806448412663
2410769821064615.55352724-167362.5099498812366.44647276410.684409797630143
2510393671020007.1367768-62890.790601232119359.86322319541.14547865516439
2610634491083917.5365834345164.8794267508-20468.53658343021.185080709421
2713351351309673.38194462196678.19822977525461.61805538131.66334635408133
2814916021472031.75864276167735.58470341219570.2413572367-0.317588360261953
2915919721588490.14551138124610.6680682073481.85448862488-0.471632508292719
3016412481707721.93334476120088.897975009-66473.9333447636-0.0495148007978715
3118988491823942.98877171116835.55884599574906.0112282916-0.0356191897324393
3217985801848904.6589369139552.8558076856-50324.6589369119-0.846106047608183
3317624441764562.08133564-64662.476808368-2118.08133564485-1.14098031432421
3416220441609137.65111193-141007.30103544212906.3488880725-0.83584892020799
3513689551396424.86450519-201320.55315407-27469.8645051933-0.660328170259007
3612629731250238.41963702-154962.6147731712734.58036298030.507591915967803
3711956501178211.66189516-85223.319199346417438.33810484320.764564637363084
3812695301299013.7493517188010.0568999051-29483.74935170641.89658182688081
3914792791446327.56839184137524.81897776332951.43160816450.542615428927656
4016078191581536.34651634135585.95307974226282.6534836635-0.0212684448479848
4117124661711511.77715323130893.192539172954.222846766093-0.0513357024751949
4217217661799806.9935678195297.5878839816-78040.9935678123-0.389706535103795
4319498431871248.3194654775353.37577624278594.6805345342-0.21837085052715
4418213261867719.921462839396.032132246-46393.9214628335-0.722108632902278
4517578021761259.23649648-87478.384271377-3457.23649648099-1.06061136852694
4615903671572182.40923038-172429.18015538918184.5907696164-0.930079379400444
4712606471297721.38495309-257731.673197424-37074.3849530888-0.933906473497344
4811492351126798.59856733-185181.56477563922436.40143266620.794472369105847
4910163671019680.90166342-119917.971686716-3313.901663416360.715242109788243
5010278851050169.307884615746.21322480324-22284.30788461061.37533144544749
5112621591213280.5680722136714.03059765348878.43192781.434508435879
5215208541481908.87526815246666.66942935338945.12473185331.20554623439595
5315441441559351.85250321105621.747152111-15207.8525032085-1.54342577943302
5415647091647632.0650319291182.5317806887-82923.0650319214-0.158059884367885
5518217761739555.7374544991799.808890211482220.26254551260.00675873584822836
5617413651781923.5752391650619.5636596885-40558.575239164-0.450848752998997
5716233861634953.41940773-113991.416630682-11567.4194077305-1.80221286015641
5814986581463629.86899661-161752.95503977835028.1310033859-0.522916605514228
5912418221286066.64976003-174921.488185682-44244.6497600334-0.144171435539331
6011360291113060.38478289-173326.69079535422968.61521711290.0174653046580764
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/1sugm1292604146.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/1sugm1292604146.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/2k3f71292604146.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/2k3f71292604146.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/3k3f71292604146.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/3k3f71292604146.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/40y3g1292604146.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/40y3g1292604146.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/564vv1292604146.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t12926040327vcnf0lrbl0ks1a/564vv1292604146.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
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time')
grid()
dev.off()
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='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