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 13:18:37 +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/t129172784643fl2a4kmxukrfq.htm/, Retrieved Tue, 07 Dec 2010 14:17:32 +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/t129172784643fl2a4kmxukrfq.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 «
9700 9081 9084 9743 8587 9731 9563 9998 9437 10038 9918 9252 9737 9035 9133 9487 8700 9627 8947 9283 8829 9947 9628 9318 9605 8640 9214 9567 8547 9185 9470 9123 9278 10170 9434 9655 9429 8739 9552 9687 9019 9672 9206 9069 9788 10312 10105 9863 9656 9295 9946 9701 9049 10190 9706 9765 9893 9994 10433 10073 10112 9266 9820 10097 9115 10411 9678 10408 10153 10368 10581 10597 10680 9738 9556
 
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'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
197009700000
290819420.62455281495-4.5890426297954-334.626271902039-1.94825201291792
390849148.2077517124-22.2303618909331-61.4190688909295-1.35872117365695
497439343.40355518114-8.8193715342712396.7083849351671.35850437495548
585879095.70202034107-19.3928504723650-504.874476723729-1.70098600051497
697319271.86407345205-13.6836322275629455.7850360802611.45024067345611
795639434.40844999122-10.0399239606939125.5140932926071.31890702427521
899989698.13795425041-5.33632031363061295.0604656373962.05127007984087
994379674.89595659924-5.62859801659247-237.581978828241-0.134046595619623
10100389807.97758753645-3.35094274695094227.5934809566931.03721999324648
1199189889.12380139853-1.9454851109925027.39829186792180.631326425854686
1292529667.85545584089-5.6050188046502-412.021472076373-1.63810580704716
1397379552.0412545418-3.61040227495166186.943252254166-0.867707542115775
1490359409.52966529666-2.68610765998603-372.045359372442-1.07943661012622
1591339311.8021903386-4.17279616924874-177.283195680046-0.672370905652503
1694879154.66553084616-8.34497094258953334.647008087387-1.05021514512539
1787009193.55821813077-6.9846990075786-494.2897316040540.333489306211107
1896279253.4586044127-5.31403601802089372.4637230323580.487484467042734
1989479171.21697982802-6.8558937647209-222.945610987148-0.570707897539624
2092839097.55670913712-7.93365258961034186.560772068260-0.499253744665062
2188299105.02135657368-7.72594706235133-276.2802347638930.115351198940874
2299479330.49146897202-5.08649185514184612.5802749847941.74711149030179
2396289424.08534386672-4.23982836968727202.2503907528360.738833540386894
2493189518.27043512378-3.77030289426937-201.9348515495240.737829998929544
2596059459.6525333162-3.83436376185997146.280162888563-0.413336377929872
2686409243.96375879017-4.5673021732229-600.392639825714-1.58347703966637
2792149214.56358112121-4.81574726388101-0.157408460500335-0.181087518937939
2895679224.46897353754-4.57916825516746342.2964654638070.105542558958506
2985479155.45177696454-5.81034756066413-607.427922744883-0.463382439639212
3091858982.89970567253-8.99400504744033204.786549860404-1.21588207581558
3194709195.98429437877-5.18028867497022270.3794909051941.64089527434201
3291239183.67228549114-5.28384289359201-60.5541585213881-0.0531211458806797
3392789382.238653821-2.87829799995906-107.6368611160591.52376779855306
34101709524.17096509914-1.54558636518991643.4076573815851.08343245497791
3594349459.87903816316-1.97218082081931-24.8282625863602-0.469477382632173
3696559554.28603843822-1.4971418164170599.09844209023150.721210944559087
3794299426.43881059238-2.046589058599064.67679322160564-0.944253596916056
3887399353.99551485272-2.45262076854173-613.825140780271-0.522791335292416
3995529400.4538714729-2.0255327633396150.7437093160060.359400179017050
4096879364.41978943982-2.42987756385864323.131332353283-0.247868711532408
4190199439.20439028914-1.34601321892296-421.4508419876910.562529215139126
4296729526.26882372462-0.047847268485069144.2969670518200.648008784330493
4392069354.29953962991-2.45049008702385-145.485846509328-1.27002892558780
4490699291.74798991872-3.19410451169397-221.756334733109-0.446692690210052
4597889527.3417025869-0.719835326329942256.6965501139551.78077301638989
46103129624.511097137840.096027957588888685.8597870709150.731020408457668
47101059836.23184526941.49713127116114265.2409342760261.58093275393686
4898639824.504981512341.4237357828263838.7154690254109-0.0987486279718978
4996569747.284836308630.997551636934981-89.9762517528914-0.586130706721582
5092959801.800005113741.33567199133678-507.68614499150.397175228268162
5199469816.170475885931.43942942766346129.6152475589620.096192398012906
5297019676.922683202960.065689968782605126.3750423304587-1.03376292817842
5390499568.96478398853-1.13769998998178-518.205210398125-0.793200338741033
54101909686.239676118570.250703430598917501.8277898474430.871968273634657
5597069795.057315726631.49455614989545-90.83765730320480.803048404502364
5697659964.837820382483.26280650936327-202.6118802677061.24985211411604
5798939928.374504672822.89852693427271-34.7169593287432-0.295842154417687
5899949736.867826754551.38879256112751260.358382812888-1.44974137909044
59104339841.258171068342.06803443808084590.0302673792870.768443002439589
60100739925.00863817952.54992803660270146.6340136989280.609127917613946
611011210052.85943286913.2801345084146957.06154181480540.932957672188076
6292669964.61454470272.69702650226427-697.100793514692-0.679604846605334
6398209805.627217455231.5097542334838517.0356306578212-1.19665516212745
64100979863.865650548211.98797486111284232.2035348082970.418831124021567
6591159841.262161059161.75920451005729-725.859346237903-0.181460233955533
66104119901.61220556342.3291757362672508.4272679715910.432962988604558
6796789895.063257502942.24374033344239-216.917323822984-0.0657746447297351
681040810131.57375659304.36484884925401272.5629337803091.74014104808724
691015310180.03756834284.72613312181003-27.76688861343380.328215053005083
701036810200.94747659534.84359730176286166.7843357439430.120589854460093
711058110156.28394818084.52340528299437425.537312848946-0.369042073997497
721059710267.04953649915.15994571093786328.1879559706250.79171878968827
731068010388.66273884895.84920868267741289.4073553899860.86687876213114
74973810404.42575585705.91101679723834-666.589716397170.0736698387168638
75955610104.89350414813.82775190582163-543.854804388791-2.26531949085490
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/1d4rx1291727913.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/1d4rx1291727913.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/35w8i1291727913.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/35w8i1291727913.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/49epo1291727913.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/49epo1291727913.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/59epo1291727913.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t129172784643fl2a4kmxukrfq/59epo1291727913.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