Home » date » 2010 » Dec » 07 »

*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, 07 Dec 2010 09:56:13 +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/07/t1291715692blrs0kzyf92vw5o.htm/, Retrieved Tue, 07 Dec 2010 10:54:52 +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/07/t1291715692blrs0kzyf92vw5o.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 «
46 62 66 59 58 61 41 27 58 70 49 59 44 36 72 45 56 54 53 35 61 52 47 51 52 63 74 45 51 64 36 30 55 64 39 40 63 45 59 55 40 64 27 28 45 57 45 69 60 56 58 50 51 53 37 22 55 70 62 58 39 49 58 47 42 62 39 40 72 70 54 65
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
14646000
26248.05977218451230.4388096478075763.545881316695841.57354753017656
36652.60754027928471.212546418871333.233982210084671.69784159753678
45955.1968978041941.425762225244690.7578023047230390.518056104064447
55856.74746578079251.442056354860360.9746499146174050.0471245700968842
66158.51231923532881.478432383988021.740156118232670.125792982206389
74155.52293291577441.03572082198720-3.65481966413236-1.81350760115556
82749.61821556402780.422091070104714-4.86177924259477-2.93940161834491
95850.88729400128190.4897050415415214.839171272739580.373688244996032
107055.07074560518640.7585685680797064.567258520467171.69258734286791
114954.74791144786330.686198814276719-2.59132078952599-0.512856998388462
125955.86196485605870.7127112301364311.844104519930830.209260503745663
134456.21029327899770.724336651337164-10.1672209657321-0.330330369268821
143652.99786558455870.550595808963865-5.21233157658326-1.99983014108562
157255.95134815749250.6795450794531779.76012727977121.09667763768074
164554.81778330729990.58393566045628-4.97509991511472-0.845724481363
175655.21006716074860.574400082490811.32727511458341-0.0933827996623771
185454.8441920572750.5305714690840651.9163361892134-0.477263984019083
195354.95888645434820.51238082511351-0.689924797490876-0.218436954150590
203552.99734966999360.410448802847295-10.2063903347090-1.33642346160890
216153.79164424891720.4254061558913185.967654873768640.212218423268656
225253.1675508917790.3866298547431442.30019097290813-0.591716224831296
234752.85580093552910.36232564533282-3.4990023275797-0.401116083199345
245152.39075114563060.3372255174513161.50411936837785-0.489986388477468
255253.13315193914850.339054207920607-2.826887025336490.286110773472820
266355.81070317647280.392831392870773-1.046243313809611.41538539512040
277457.63324909858030.43680034932158211.73243514664420.807281734840497
284557.07034066211450.404417354131301-8.87141218919692-0.559501095878015
295156.06816860253090.359638497420152-0.510231058219521-0.796994854466369
306456.94953483358390.3756040846005345.327923193201880.300736105834529
313654.10303938766450.281393320613122-7.2681865324244-1.88836276403969
323051.87799109945640.211399010945687-13.3115959268030-1.49061077732025
335551.09912196465140.1849767752229937.33378245168349-0.596482511333149
346452.47382568901020.2151857574439167.346993691097190.725080347463454
353951.37606926412070.184192139087732-7.69268005990597-0.810889291688109
364049.71307455317840.147642570274642-2.9387304010156-1.16850670005281
376351.84059642238620.1671914467336453.381778827306351.3376441979419
384551.57798602013480.160131530081514-4.99493046061466-0.274098748821633
395950.8951085023760.14219036073011611.0615153520207-0.515707765343614
405552.53463722077140.176807223093539-2.703256318291230.90460011278997
414051.14623974480660.140270282058093-5.73373085676533-0.948006943457502
426451.62595629990330.14803183301240011.19006505571760.207289558900143
432749.06503559699830.0881076514158906-12.5172993555984-1.67021700097748
442847.582228843410.0546667273702632-13.9882077766203-0.977654965159655
454546.09535225448830.02322560901996604.44812177250886-0.967850638149091
465746.12379588417590.023326533272075310.85725209701930.00330500071976019
474546.82243652754280.0353458485571801-4.305279367450360.432263225001445
486950.46973073282440.08971518122554624.994540797398192.35094343313774
496051.78561128046610.1028378875692863.481019761941190.820339889895021
505653.26530766050750.121261940597883-2.433869728991060.898329857720658
515852.895165760790.1132450877464176.89674204132185-0.312747898662718
525052.70906927590890.107906503517759-1.63188193443569-0.188475617741982
535153.2132408359090.115155321105339-3.636690267640130.249291393763048
545351.42092948279910.08050877264447118.45857807320653-1.20484683301625
553750.715228833050.0665610586463731-10.8615549477149-0.499572656763515
562248.50979722500970.0275639274452978-18.2044626383856-1.45305366354837
575548.53338455767810.02749844483703306.48125901181083-0.00256000560218153
587050.15731616531370.052374408896530313.91753676527201.03485707997136
596253.04777398252010.0930402180971634-1.681447983932381.85489353670178
605853.76581164160950.1008271222482031.862446233401460.413073638120074
613951.80770174297760.0795282592978184-4.88575862293053-1.37785229209219
624951.45445580278780.0745312288340987-0.811612224101413-0.286117634131379
635851.31386795370370.07166408594170437.48854516362709-0.140089812690450
644750.91470853189990.0648480367139138-2.17594801076229-0.304099694632655
654249.90052414994840.0487102047337609-3.92637963360346-0.695636940269711
666250.08476800135770.050740784627981511.41516708159770.0875473461718351
673949.8678900161970.0467970781302325-9.87647960925-0.173532429737553
684051.05941514310410.0631894214363188-15.32175374013260.745742192752294
697253.45615763089150.09530749927428239.805967407543471.52788565374017
707054.56979327958160.10858262467761811.59341614652550.670388347514449
715454.98525582538180.112283011449092-2.149859010415510.203296282712907
726555.9285436969990.1212533376949375.890958976582860.554615216213689
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/1zezp1291715768.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/1zezp1291715768.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/2a6ys1291715768.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/2a6ys1291715768.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/32xfv1291715768.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/32xfv1291715768.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/42xfv1291715768.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/42xfv1291715768.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/52xfv1291715768.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291715692blrs0kzyf92vw5o/52xfv1291715768.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 1 ; par4 = 12 ;
 
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 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