Home » date » 2010 » Dec » 10 »

WSvraag5

*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, 10 Dec 2010 13:55:58 +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/10/t1291989418nbs8cv00xl53l48.htm/, Retrieved Fri, 10 Dec 2010 14:56:58 +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/10/t1291989418nbs8cv00xl53l48.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 «
13328 12873 14000 13477 14237 13674 13529 14058 12975 14326 14008 16193 14483 14011 15057 14884 15414 14440 14900 15074 14442 15307 14938 17193 15528 14765 15838 15723 16150 15486 15986 15983 15692 16490 15686 18897 16316 15636 17163 16534 16518 16375 16290 16352 15943 16362 16393 19051 16747 16320 17910 16961 17480 17049 16879 17473 16998 17307 17418 20169 17871 17226 19062 17804 19100 18522 18060 18869 18127 18871 18890 21263 19547 18450 20254 19240 20216 19420 19415 20018 18652 19978 19509 21971
 
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
11332813328000
21287313200.60943725763.82152215418458-327.60943725757-1.30910910455104
31400013460.252713378221.9988103836074539.7472866218031.31766718817925
41347713535.986936847526.2778514725775-58.98693684750910.3119018951803
51423713789.380687607442.1621864062807447.6193123926241.58143678363955
61367413834.078546832842.304813576799-160.0785468327980.0192401175127454
71352913756.194174572836.7695778352094-227.194174572758-0.93687477922123
81405813824.108092922638.0413651349866233.8919070773720.243932780905403
91297513582.498439751627.0308655431981-607.498439751644-2.18563522321182
101432613729.747079441631.8415148666767596.2529205584470.935635145334216
111400813869.995006720536.3416212726261138.0049932794520.83989232790268
121619314657.751026420568.75452352292061535.248973579515.79778333316117
131448314940.968016369973.3764539119965-457.9680163698851.70441853624671
141401114973.304688225872.3101107570872-962.304688225774-0.329014378964596
151505714910.203527235866.739967786076146.796472764226-1.01366319307546
161488414966.765965331066.2089827983878-82.7659653309797-0.0721838684600287
171541414983.384596991863.3965754736545430.615403008248-0.352180429765533
181444014841.901262787951.7595341466996-401.901262787872-1.49386554764302
191490014877.572056401550.877898261684422.4279435984515-0.119893630636551
201507414855.282627259147.0432538657153218.717372740914-0.550703589224719
211444214996.138440519651.7709122935584-554.13844051960.707320665841406
221530715086.873875396653.6729327269379220.1261246033810.29317698821905
231493815227.867554008157.8168114646312-289.8675540080740.655223717116413
241719315465.187877777766.11861283523581727.812122222261.34613900460798
251552815699.356854263273.7849643858837-171.3568542632051.26383314497992
261476515768.896899981473.5864325978395-1003.89689998135-0.0318767913317064
271583815770.225099242470.022796617075967.7749007576431-0.53598968203871
281572315767.794008326466.2585553298344-44.794008326355-0.529666835606198
291615015725.549782990460.4284412968454424.450217009605-0.78914526021634
301548615780.155127015460.111468623206-294.155127015362-0.0425722754290249
311598615877.228637281662.1175757953697108.7713627184400.272499822725137
321598315928.547771348761.538676227111454.4522286513501-0.0800430636830513
331569216100.19146046367.3471799287255-408.1914604630150.816985506429388
341649016281.835561045773.2823838806303208.1644389542550.846804441462566
351568616325.100987659171.7432917911031-639.100987659145-0.222069430077944
361889716660.862017433585.18305080291852236.137982566501.95350170875901
371631616722.820466924284.000666347788-406.820466924182-0.172016459264779
381563616713.57660316279.2163022303728-1077.57660316201-0.690270569590547
391716316831.775272491081.242312767349331.2247275089730.287597218590611
401653416796.035807653275.0806559430563-262.035807653178-0.859203182183173
411651816595.763214220760.4294612260057-77.763214220708-2.01772361813529
421637516599.69346808957.407487084985-224.693468089016-0.414444134280058
431629016513.574055976749.7272941782886-223.574055976672-1.05580442807704
441635216484.458833482245.5216189412185-132.458833482220-0.581264011985356
451594316491.132400767643.4599349205430-548.132400767599-0.286540543738518
461636216429.665483083937.9219342010331-67.6654830839178-0.773357579733872
471639316668.180540711348.4616659078146-275.1805407113431.47741432595823
481905116787.462605731452.17348804589522263.537394268620.521644691090645
491674716927.772285837456.792677707048-180.7722858374190.649525131657709
501632017113.104170935863.5441761274461-793.1041709357860.947301688069572
511791017270.620728813968.4977148282845639.379271186090.691872668321675
521696117247.86541415963.6692206290222-286.865414158987-0.67085706019038
531748017325.068027142264.387494933109154.9319728577680.0993994143963147
541704917312.027770090460.2709331837657-263.027770090449-0.568790491786287
551687917242.323303609553.3581514597171-363.323303609512-0.955697068414683
561747317351.463417588556.3226004544241121.5365824114670.410502924565005
571699817478.671949963160.0840640137906-480.6719499631010.521762688225939
581730717568.384236594361.6535247190075-261.3842365942740.21801502975952
591741817693.238968756664.9964281204076-275.2389687566170.464906342198786
602016917860.159205893170.38270722124312308.84079410690.749748252953783
611787118029.545304558675.6140177325728-158.5453045586060.728434546245092
621722618110.440178205875.8932174272593-884.440178205750.0388587135122467
631906218234.470092425878.4407947006641827.5299075741540.354115600480104
641780418242.099181142574.6889953333371-438.099181142517-0.5206638162686
651910018466.823152610982.6455779130433633.176847389151.10276967932766
661852218650.022396045187.9810633800512-128.0223960450760.739082059332285
671806018689.525478585385.4083722329187-629.525478585296-0.356426798586708
681886918776.595620915185.496544124584692.40437908485570.0122216771278885
691812718804.520574680982.4431636156105-677.520574680931-0.423455696205232
701887118980.913044849487.4232641499781-109.9130448494240.690945687987493
711889019161.226321572392.3448685963206-271.2263215723370.683059514657614
722126319208.340009443589.94911582569272054.65999055652-0.332598175819422
731954719420.026166671296.3966483906145126.9738333288210.895250386793068
741845019505.233220722295.8039317238105-1055.23322072221-0.0822934402494889
752025419548.793369715693.0357655513966705.206630284366-0.384200720802587
761924019679.905850945595.0539453246925-439.9058509455030.279969699295708
772021619740.469860158493.2253639804314475.530139841585-0.253560638247648
781942019722.554141454487.3318635868154-302.554141454413-0.817063950179949
791941519854.625964114589.7044383627577-439.6259641145130.328941624394363
802001819957.113073549590.382276765725860.88692645049660.0939926577936619
811865219856.404442617680.250344656764-1204.40444261761-1.40517312873333
821997819952.881292408281.11056421088725.11870759180290.119315648765566
831950919964.528345092577.428629017943-455.52834509247-0.510744834039157
842197120006.573393243675.55330645478591964.42660675644-0.260161365412173
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/1q4d71291989353.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/1q4d71291989353.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/2q4d71291989353.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/2q4d71291989353.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/3jvda1291989353.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/3jvda1291989353.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/4unuc1291989353.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1291989418nbs8cv00xl53l48/4unuc1291989353.ps (open in new window)


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