Home » date » 2009 » Dec » 05 »

verbetering workshop

*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: Sat, 05 Dec 2009 09:00:54 -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/05/t1260028897cea2wu14s537ruu.htm/, Retrieved Sat, 05 Dec 2009 17:01:44 +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/05/t1260028897cea2wu14s537ruu.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 «
29.837 29.571 30.167 30.524 30.996 31.033 31.198 30.937 31.649 33.115 34.106 33.926 33.382 32.851 32.948 36.112 36.113 35.210 35.193 34.383 35.349 37.058 38.076 36.630 36.045 35.638 35.114 35.465 35.254 35.299 35.916 36.683 37.288 38.536 38.977 36.407 34.955 34.951 32.680 34.791 34.178 35.213 34.871 35.299 35.443 37.108 36.419 34.471 33.868 34.385 33.643 34.627 32.919 35.500 36.110 37.086 37.711 40.427 39.884 38.512 38.767
 
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
129.83729.837000
229.57129.5904101308721-0.0133242641154774-0.0194101308721427-0.17267886155883
330.16730.1047348709764-0.005909384380049260.06226512902364830.605236883566329
430.52430.501641415157-0.004179038175154780.02235858484297970.465018942038387
530.99630.9600424996861-0.002145423958800760.03595750031386140.533814451603976
631.03331.043723916878-0.0017382534660389-0.01072391687797810.0990378455712055
731.19831.1855986527485-0.001053292846705380.012401347251540.165718174423698
830.93730.9703722757926-0.00206851236682920-0.0333722757925578-0.247137480390282
931.64931.56832546292450.0007606616313914840.08067453707552460.692367551695651
1033.11532.96697435538560.007320744575351670.1480256446144481.61301391693064
1134.10634.02695156232010.01223771499630330.07904843767985251.21464204037963
1233.92633.96628860000610.0118987770802128-0.0402886000060978-0.0841180582279495
1333.38233.64256321706150.0253993900842476-0.260563217061456-0.454947411146312
1432.85132.99634941466910.0118802614321193-0.145349414669093-0.682761335064029
1532.94832.88626091213580.01043686881788780.0617390878641806-0.138488356549693
1636.11235.60117169341610.02048991032763160.5108283065839313.11982486439929
1736.11336.12328668133580.0216534239626073-0.01028668133584050.578398052153586
1835.2135.39599296387460.0197223411603790-0.185992963874635-0.86342346026361
1935.19335.12739303948180.01892955630110040.0656069605182098-0.332379312508679
2034.38334.51689487304190.0171866649800633-0.133894873041891-0.72560701664154
2135.34935.21295435725210.01906795673756780.1360456427478780.782616549966365
2237.05836.76443738844330.02349886859720210.2935626115566781.76682355991305
2338.07637.87891403313410.02675459807943450.1970859668659481.25817438197546
2436.6336.88815783169530.026927063691355-0.258157831695279-1.17198633735714
2536.04536.32084911211410.0360231237032054-0.27584911211414-0.728019554868669
2635.63835.80284412337710.0303057283601594-0.164844123377064-0.604216925552623
2735.11435.49224579049710.0269064083517163-0.378245790497122-0.385678633268819
2835.46535.10784169225630.02514323918182640.357158307743745-0.474070437016384
2935.25435.13094895355220.02513892305408610.123051046447826-0.00234747396731997
3035.29935.37860716744340.0255792414598661-0.0796071674434010.256492010881536
3135.91635.66430185395430.02614332224164760.2516981460457020.299795559696390
3236.68336.68098830392770.02839031920654360.002011696072294211.14162873663866
3337.28837.30925124562620.0298066248179012-0.02125124562617510.691426217013282
3438.53638.27832734610310.03217001722156510.2576726538969381.08289814159513
3538.97738.62874511426320.0328204539956010.3482548857367860.366842156635779
3636.40736.97026961551710.0354773476946675-0.563269615517122-1.94993671953989
3734.95535.46875428681280.0472402791711909-0.513754286812814-1.82215152704289
3834.95135.078785083540.0445433039359075-0.12778508354-0.489271776903668
3932.6833.31479265217650.0296570253826546-0.634792652176517-2.04713670542767
4034.79134.13839831489750.03330056712476410.6526016851025090.91392495796003
4134.17834.09060784292910.03311421093326990.0873921570709282-0.093497319211094
4235.21335.08981053689890.03483435639752960.1231894631011241.11357427407276
4334.87134.86650578459260.03434938868364170.00449421540735816-0.297500737433527
4435.29935.30578544972490.0351771726574544-0.006785449724849780.466664131864935
4535.44335.61749339750680.0357874675447234-0.1744933975068260.318735557420587
4637.10836.72534055557790.03818060372674050.3826594444221261.23593266476961
4736.41936.0235117468240.03721409431332520.395488253175966-0.852612568478296
4834.47135.00222522198390.0391053647949012-0.531225221983899-1.22132885973800
4933.86834.36739703096070.0419179790588139-0.499397030960679-0.787685747978609
5034.38534.17556547019420.04093939119587560.209434529805770-0.264536020689637
5133.64334.34823766035580.0418350390695929-0.7052376603557940.149409793657213
5234.62734.02848234110380.0401712742245340.59851765889616-0.415727421471527
5332.91933.17351094191280.0379213262905128-0.25451094191284-1.03196235268091
5435.534.89107003600980.04087775055291370.608929963990221.93610259308469
5536.1135.98348836572790.04270215650015350.1265116342721211.21189797710201
5637.08636.99887580295680.04456142160979690.0871241970431841.12100074569387
5737.71137.95197409597200.0464443933682000-0.2409740959720491.04722999082765
5840.42739.61051913731810.04955554959008420.8164808626819411.85825418146147
5939.88439.43689153683610.04937502695613070.447108463163941-0.257076126273345
6038.51239.05781367103530.0500524703842053-0.545813671035337-0.494451743531779
6138.76739.22680608933070.0497749784745955-0.4598060893307370.138046923122567
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/1kgi81260028851.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/1kgi81260028851.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/2lr6v1260028851.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/2lr6v1260028851.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/3rgoq1260028851.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/3rgoq1260028851.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/432t61260028851.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1260028897cea2wu14s537ruu/432t61260028851.ps (open in new window)


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