Home » date » 2009 » Dec » 04 »

ws9

*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 12:58:05 -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/t1259956780699ffzkhgdtf705.htm/, Retrieved Fri, 04 Dec 2009 20:59:47 +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/t1259956780699ffzkhgdtf705.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:
ws9.10
 
Dataseries X:
» Textbox « » Textfile « » CSV «
126.51 131.02 136.51 138.04 132.92 129.61 122.96 124.04 121.29 124.56 118.53 113.14 114.15 122.17 129.23 131.19 129.12 128.28 126.83 138.13 140.52 146.83 135.14 131.84 125.7 128.98 133.25 136.76 133.24 128.54 121.08 120.23 119.08 125.75 126.89 126.6 121.89 123.44 126.46 129.49 127.78 125.29 119.02 119.96 122.86 131.89 132.73 135.01 136.71 142.73 144.43 144.93 138.75 130.22 122.19 128.4 140.43 153.5 149.33 142.97
 
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
1126.51126.51000
2131.02130.9172025576033.922462398493990.1027974423967750.913847618431535
3136.51136.4750507740945.42119632706690.03494922590641520.323228539519454
4138.04138.1733013618722.03974118144753-0.133301361871803-0.735301004209409
5132.92133.129974122407-4.40470661680805-0.209974122406907-1.40484469512538
6129.61129.480225546292-3.717711940008010.1297744537076340.149751215420113
7122.96123.045183923431-6.19027272624965-0.0851839234314419-0.538970318236795
8124.04123.7168277006870.05352586462674490.3231722993127941.36102692742256
9121.29121.422930675273-2.08245193375971-0.132930675272830-0.465601717116753
10124.56124.3141271415182.443194510302420.2458728584818930.986503116255774
11118.53118.859869616276-4.74289199990166-0.329869616275619-1.56642743172016
12113.14113.072065188506-5.693683592720460.067934811494016-0.207254119571685
13114.15113.8200569643360.1372939182953190.3299430356635691.30617668807452
14122.17121.9486270697426.939000467530010.2213729302583751.47143578272947
15129.23129.2511336838347.26134583979489-0.02113368383364440.0702956150792457
16131.19131.2271402685832.59179533094804-0.0371402685830076-1.01410308589435
17129.12129.610135228349-1.13022730994044-0.490135228349003-0.81138113179795
18128.28127.762037961368-1.765408344265890.517962038632025-0.138455307850871
19126.83127.221648312564-0.681581329417607-0.3916483125643960.236253344661319
20138.13136.8915326901928.476391429701181.238467309808161.99626004787833
21140.52141.4961257902485.05100180883885-0.976125790247784-0.74666856805515
22146.83146.182029038094.727986411983330.647970961910118-0.0704111087827684
23135.14136.055343646103-8.4155049146763-0.91534364610312-2.86507463687213
24131.84131.499688352674-5.003259277907220.3403116473260010.744031465440659
25125.7126.360997728313-5.12301346878176-0.660997728313063-0.0264407527440768
26128.98128.6209328678651.194432318997730.3590671321346681.36993223458147
27133.25132.8519182098843.844950030716380.3980817901163530.579569553661896
28136.76136.5475027480483.714542455884710.212497251952143-0.0283266193563843
29133.24133.965409953674-1.78161478605764-0.725409953673718-1.19793769414372
30128.54127.911717517843-5.513757074697940.62828248215724-0.813530457709215
31121.08122.310659902517-5.59002397324516-1.23065990251707-0.0166246282184823
32120.23118.583910619587-3.962376690870601.646089380412870.354795577877309
33119.08120.2041317921440.914229817306783-1.124131792144421.06300566305370
34125.75123.6345213008533.112374914014782.115478699147340.479156498736774
35126.89128.0255243196594.22934775702417-1.135524319659490.243479856030229
36126.6126.398505058157-0.8803570271939270.201494941842746-1.11480800848040
37121.89123.409157055347-2.72377114043586-1.51915705534704-0.404211138730694
38123.44123.244178250926-0.5291310873577380.1958217490737220.476768191036138
39126.46126.0858984535262.390640714310060.3741015464744180.638570867909091
40129.49128.8503328233472.715120176313260.6396671766527580.0705390064677417
41127.78128.341115013476-0.0810618756463612-0.561115013476304-0.609307726939597
42125.29124.751529462-3.126459445139000.538470538000142-0.663852200903137
43119.02120.215944328442-4.34972998793681-1.19594432844207-0.266645656308553
44119.96118.472109226178-2.087709059507521.487890773822380.493076694308836
45122.86123.7084812740124.26988405475962-0.8484812740123931.38583280540139
46131.89130.047822693326.066389922338371.842177306679890.391610356978546
47132.73133.5839678995463.8703892911244-0.853967899546154-0.478679383073456
48135.01134.6876289933311.471563156861950.322371006669465-0.523544218885862
49136.71138.2254582875333.2660477324634-1.515458287533040.392236526720319
50142.73142.8027396066044.39140544766192-0.07273960660359830.244751629264758
51144.43144.4562567675022.02957335327447-0.0262567675020932-0.516298599702921
52144.93144.2974050851100.1363657992898240.632594914889814-0.411906978939660
53138.75139.335339537302-4.26872744002087-0.585339537301886-0.959709989279856
54130.22129.675203425735-8.930548936815140.544796574264559-1.01622860367565
55122.19123.117440954077-6.87835319583681-0.9274409540767650.447330940491508
56128.4126.8472465735522.296159832162281.552753426448371.99986096975472
57140.43140.85442505885312.4245091137639-0.4244250588531412.20779437417532
58153.5151.65960329588111.02398526375451.84039670411948-0.305292617967822
59149.33150.6605975219160.629629190843078-1.33059752191579-2.26577833702963
60142.97143.360339514032-6.22189287681627-0.390339514032104-1.49545917193968
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/1arjq1259956683.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/1arjq1259956683.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/2xdcr1259956683.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/2xdcr1259956683.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/3gznf1259956683.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/3gznf1259956683.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/5hs8d1259956683.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259956780699ffzkhgdtf705/5hs8d1259956683.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = 12 ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
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