Home » date » 2009 » Dec » 04 »

*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, 04 Dec 2009 10:56:50 -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/04/t1259949547b00hdvseiqlxmxi.htm/, Retrieved Fri, 04 Dec 2009 18:59:16 +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/04/t1259949547b00hdvseiqlxmxi.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 «
2849,27 2921,44 2981,85 3080,58 3106,22 3119,31 3061,26 3097,31 3161,69 3257,16 3277,01 3295,32 3363,99 3494,17 3667,03 3813,06 3917,96 3895,51 3801,06 3570,12 3701,61 3862,27 3970,1 4138,52 4199,75 4290,89 4443,91 4502,64 4356,98 4591,27 4696,96 4621,4 4562,84 4202,52 4296,49 4435,23 4105,18 4116,68 3844,49 3720,98 3674,4 3857,62 3801,06 3504,37 3032,6 3047,03 2962,34 2197,82 2014,45 1862,83 1905,41 1810,99 1670,07 1864,44 2052,02 2029,6 2070,83 2293,41 2443,27 2513,17
 
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
12849.272849.27000
22921.442917.763133991155.137905834803853.676866008845350.264174667852236
32981.852978.1278980311911.23236166301193.722101968812980.338719245348942
43080.583076.7969032280924.20282191391443.783096771913550.524636601294583
53106.223102.4360766187924.4542209290673.78392338120640.0084812578178234
63119.313115.5313533318122.26431775995253.77864666818843-0.0663376075692007
73061.263057.511033255915.870325678917593.74896674408907-0.465499328144555
83097.313093.5522369470712.24705693817273.757763052930640.174130835969007
93161.693157.9203199875423.49353683618063.769680012457830.299950075187489
103257.163253.3774611068239.21644848150033.782538893183450.413402697369485
113277.013273.2301594701834.95385355107383.77984052981891-0.111114812339812
123295.323291.5419657344431.27375577508833.77803426556331-0.0954323118956617
133363.993381.4269533339243.7382114887806-17.43695333391940.391778289159546
143494.173491.1020052475657.85186384621923.067994752439780.317896052319807
153667.033664.0617818767683.4643930673972.968218123237140.658757311629081
163813.063810.1339744125197.39666399441962.926025587494360.358375195739271
173917.963915.0379077324899.06743869484432.922092267521850.0429793591223882
183895.513892.5383909581972.00989596540472.97160904181063-0.696059101657574
193801.063798.0356637723334.94600100599363.02433622767383-0.953494777019992
203570.123567.03019516236-24.25538701104253.08980483764101-1.52301749022897
213701.613698.5500054648510.42217647632423.0599945351510.892123635120283
223862.273859.2323589138743.87330958599443.037641086134880.860576334564032
233970.13967.0697560843158.11352058717393.030243915690380.366350051019184
244138.524135.4996734252682.67365824332263.020326574738870.631846223109648
254199.754230.5640568471385.3916521685081-30.81405684712540.0768490048576036
264290.894288.4854038561279.43420603590862.4045961438822-0.142027442385313
274443.914441.549983775295.83984644786552.360016224795370.421427346514012
284502.644500.2625106666587.57066280996172.37748933335368-0.212544699497747
294356.984354.5171570654935.61621780988462.46284293451407-1.33587653254883
304591.274588.8636710034279.86437503021132.40632899657891.13797584921890
314696.964694.559381303585.61553775242362.400618696502930.147928025980703
324621.44618.9716794439949.72550601318892.42832055600669-0.923215444774458
334562.844560.3972121589425.61386019208372.44278784106401-0.620264419110675
344202.524200.03713105689-60.31883188683362.48286894311003-2.21065512929778
354296.494294.01958690279-25.96514259035452.470413097212810.883778750285135
364435.234432.7699230576910.70748586244052.460076942311460.94344545845217
374105.184167.37148713995-50.1819026991242-62.1914871399531-1.66893610767262
384116.684111.09118841473-51.51358008122065.58881158527523-0.0324681561925759
393844.493838.8018394913-100.6961533051205.6881605086983-1.26387849756210
403720.983715.28385723677-105.7787427679235.69614276323134-0.130668861223294
413674.43668.71995664016-92.59323089774745.680043359837040.339078839393447
423857.623851.99826090203-31.16924883098295.62173909797331.57983645428615
433801.063795.43408875761-36.82331875537885.625911242391-0.145438008795883
443504.373498.71089630002-94.6880204719795.6591036999766-1.48852521020575
453032.63026.90345650104-178.6505079515005.69654349895634-2.15994812306076
463047.033041.34835859982-135.6592916168365.681641400176211.10597969054765
472962.342956.66141654926-124.3106225595885.678583450736420.291956419034426
482197.822192.11155878457-266.8567305988195.708441215433-3.66717716307664
492014.452064.11497959758-236.158079925354-49.66497959757940.828389947333573
501862.831858.06098260740-229.5576007178044.769017392598090.162901085914849
511905.411900.73827178121-168.9180272814174.671728218785721.55865684837942
521810.991806.33897240724-152.3229882892434.651027592762650.426703256060083
531670.071665.4214352507-149.7833541487784.64856474929910.065314780566455
541864.441859.84921339512-73.14334947247814.590786604880221.97129588133215
552052.022047.46323802728-15.08644767222914.556761972717621.49342691045499
562029.62025.04249409234-16.71938849362044.55750590765862-0.0420069356825406
572070.832066.27706370684-3.816287254334224.5529362931590.331938029389666
582293.412288.8709412319346.59270549075844.539058768069521.29681608710483
592443.272438.7358618387569.58580789364194.534138161249970.591524112987543
602513.172508.6358734763969.65576432717154.534126523608810.00179972133477979
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/16w131259949408.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/16w131259949408.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/21eyj1259949408.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/21eyj1259949408.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/36xlo1259949408.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/36xlo1259949408.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/4hdwd1259949408.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259949547b00hdvseiqlxmxi/4hdwd1259949408.ps (open in new window)


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