Home » date » 2009 » Dec » 10 »

verbetering

*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: Thu, 10 Dec 2009 10:10:47 -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/10/t1260465098oef22y0o3ce5kev.htm/, Retrieved Thu, 10 Dec 2009 18:11:45 +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/10/t1260465098oef22y0o3ce5kev.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 «
102.86 102.55 102.28 102.26 102.57 103.08 102.76 102.51 102.87 103.14 103.12 103.16 102.48 102.57 102.88 102.63 102.38 101.69 101.96 102.19 101.87 101.6 101.63 101.22 101.21 101.49 101.64 101.66 101.77 101.82 101.78 101.28 101.29 101.37 101.12 101.51 102.24 102.94 103.09 103.46 103.64 104.39 104.15 105.21 105.8 105.91 105.39 105.46 104.72 103.14 102.63 102.32 101.93 100.62 100.6 99.63 98.9 98.32 99.22 98.81
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1102.86102.86000
2102.55102.565682179366-0.0241017981932413-0.0156821793657601-0.418447443081315
3102.28102.295654255638-0.0590197890480614-0.0156542556376815-0.547626616947499
4102.26102.275657863465-0.0517706878412844-0.01565786346507310.0846528878937142
5102.57102.5856841615990.0255774064202126-0.01568416159863390.77123147447451
6103.08103.0957112499130.137359171386002-0.01571124991344351.02151188726503
7102.76102.7756918296320.0272945100648635-0.0156918296321747-0.958216547410568
8102.51102.525682955471-0.041008229438491-0.0156829554710754-0.578790293818229
9102.87102.8856925865880.0590525893512763-0.01569258658783970.835233604496448
10103.14103.1556963796650.112068676529851-0.01569637966465310.438841052469211
11103.12103.1356946041420.0787435722540339-0.0156946041417716-0.274561944132307
12103.16103.1756942150.068945530657078-0.0156942149998998-0.0805149633735772
13102.48102.575864924310-0.0942567935268288-0.0958649243103273-1.61460401257669
14102.57102.559541291563-0.07541643305626790.01045870843717040.135582455788541
15102.88102.8699746552700.02252969188612050.01002534473042290.80029042560907
16102.63102.619746024090-0.04666489815906810.0102539759095662-0.565977416656666
17102.38102.369618730044-0.09826475807108720.0103812699560964-0.422313943435951
18101.69101.679342265555-0.2483851991230640.0106577344450224-1.22905562572630
19101.96101.949523026306-0.1168941970665050.01047697369446821.07673397188970
20102.19102.179613308323-0.02891052955602450.01038669167691030.720542140046447
21101.87101.859556763784-0.1027366624992940.0104432362158988-0.604633885219041
22101.6101.589532512824-0.1451568378570060.0104674871757102-0.347431163266818
23101.63101.619551467726-0.1007354467446890.01044853227434150.363828098679409
24101.22101.209526487745-0.1791671242401110.0104735122548333-0.642391691130274
25101.21101.278359709834-0.117221366123082-0.0683597098338070.556644237990322
26101.49101.479211673508-0.03903248285834650.01078832649219170.594617454136453
27101.64101.6293534804290.00899109377883230.01064651957099390.392534199004252
28101.66101.6493596425840.01178572855410510.01064035741552410.0228634951773747
29101.77101.7594006678930.03670685251349910.01059933210741230.203988177108418
30101.82101.8094048119850.0400790747338470.01059518801501280.027610610650106
31101.78101.7693861797550.01976724260057790.0106138202445912-0.16633251119359
32101.28101.269295916727-0.1120603957884080.0107040832726320-1.07962398180594
33101.29101.279311737844-0.08110372544396840.01068826215608140.253537069583334
34101.37101.359327323774-0.04024592627682630.0106726762258370.334637023681791
35101.12101.109312177555-0.09344133781467730.0106878224453378-0.435692178920362
36101.51101.4993382334130.02916260097882270.01066176658690961.00418487210583
37102.24102.2662032250940.214411009207366-0.02620322509353711.61463476533749
38102.94102.9328231497500.3264946819025290.007176850250427310.871317560731968
39103.09103.0827250580480.2816766163848810.00727494195247039-0.366527153335146
40103.46103.4527616879470.3040920454550780.00723831205265830.183439465808140
41103.64103.6327232806720.2726090572347450.0072767193277125-0.257741715202036
42104.39104.3828335563250.3937047066637140.007166443674817120.991580874127709
43104.15104.1427243009020.2329742995824090.00727569909844755-1.31627989799212
44105.21105.2028307235040.4427262561213310.007169276495499861.71784674455270
45105.8105.7928448685240.4800769708997050.007155131475732130.305909538284946
46105.91105.9028183385890.3862218071565360.0071816614112087-0.768707330585288
47105.39105.3827698492840.1563972387977670.00723015071617186-1.88236647106921
48105.46105.4527663988050.1344863756644570.00723360119541531-0.179460935387349
49104.72104.865725642857-0.047162469548292-0.145725642857173-1.55911141587972
50103.14103.140841115573-0.465004433973417-0.000841115573391832-3.28718271230301
51102.63102.630821263224-0.476427293630119-0.000821263223674354-0.093446718219952
52102.32102.320876057764-0.434196321776809-0.0008760577636347220.345662807929606
53101.93101.930886917534-0.422984349636314-0.0008869175344378670.0917979615088299
54100.62100.620724247123-0.647975545765978-0.000724247123189815-1.84242012302064
55100.6100.600810202774-0.488702372453864-0.000810202774196431.30438547197669
5699.6399.6307610320795-0.610768309656651-0.000761032079550974-0.999724171123227
5798.998.9007519403006-0.641006918798332-0.000751940300637301-0.247662346523827
5898.3298.3207554124853-0.625535032553002-0.0007554124853190580.126720939011964
5999.2299.2208202182434-0.23864900116482-0.000820218243382263.16877963671013
6098.8198.81081478516-0.282104592272321-0.000814785160120457-0.355923617417946
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/1wsqi1260465045.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/1wsqi1260465045.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/2w0fx1260465045.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/2w0fx1260465045.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/39ov91260465045.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/39ov91260465045.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/4rlce1260465045.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260465098oef22y0o3ce5kev/4rlce1260465045.ps (open in new window)


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