Home » date » 2009 » Dec » 04 »

WS 9, Populair model 3

*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 09:02:52 -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/t1259942693kapxohb7eitp7zq.htm/, Retrieved Fri, 04 Dec 2009 17:04:59 +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/t1259942693kapxohb7eitp7zq.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 «
95.1 97 112.7 102.9 97.4 111.4 87.4 96.8 114.1 110.3 103.9 101.6 94.6 95.9 104.7 102.8 98.1 113.9 80.9 95.7 113.2 105.9 108.8 102.3 99 100.7 115.5 100.7 109.9 114.6 85.4 100.5 114.8 116.5 112.9 102 106 105.3 118.8 106.1 109.3 117.2 92.5 104.2 112.5 122.4 113.3 100 110.7 112.8 109.8 117.3 109.1 115.9 96 99.8 116.8 115.7 99.4 94.3
 
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
195.195.1000
29795.6172457653417-0.0179137176742521.382754234658300.355983429664942
3112.7103.5100616272320.5340923194878279.189938372768072.67772412401643
4102.9105.4251076176920.641816735585187-2.52510761769160.524277643898397
597.4103.3551962666260.460294618783866-5.95519626662574-1.24098426251121
6111.4105.2457309838250.5332805092316346.15426901617550.718438978345372
787.4100.4666726477180.329844159680205-13.0666726477184-2.75926564762998
896.897.672784523050.234102247883548-0.872784523050115-1.63863215627200
9114.1101.6933542373650.33663223555950012.40664576263471.98989980491086
10110.3105.7755021953270.4338824502431264.524497804672641.96626962392249
11103.9106.6795445621540.446107526520085-2.77954456215430.246334626336542
12101.6105.4605103913420.402164682467852-3.86051039134245-0.870790832135682
1394.6103.1481338389920.405379607507195-8.54813383899242-1.47301299519722
1495.9101.7544218949180.402709771371073-5.8544218949178-0.984415504282895
15104.799.36325425671940.3504626435315585.33674574328056-1.42367769403096
16102.899.74685114918540.3515346366261283.053148850814630.0159369830328408
1798.1100.8773749058810.381386334477444-2.777374905880530.374405975970588
18113.9102.1867256387730.41703308506737911.71327436122680.458675404508563
1980.9100.2017226910660.332036963937143-19.3017226910665-1.21903554616217
2095.799.86950202548030.311129466062295-4.16950202548029-0.342395782714928
21113.2100.9466128778360.33244735500771612.25338712216360.397518723956748
22105.9101.3508794106910.3342171266034764.549120589309240.0373398207251376
23108.8103.9135043927720.3824801656873094.886495607228411.15844417296230
24102.3104.6535146927400.38919806339569-2.353514692740420.185972813927420
2599105.2332420319010.392389111935568-6.233242031901200.0993119002920132
26100.7105.4438996787980.389169397687618-4.74389967879805-0.0942976122775373
27115.5107.1978436013670.4184584285606638.302156398633390.696945241968241
28100.7105.0995509225060.353254968432263-4.39955092250612-1.2629212179917
29109.9106.7846600190470.3921723827496673.115339980952940.663873067526193
30114.6105.7236340082280.3475939529422338.87636599177186-0.728312784310215
3185.4105.2238029187730.321815495199988-19.8238029187726-0.429238487890929
32100.5105.3473614133830.316066024321495-4.84736141338333-0.101341346478198
33114.8104.9920693048840.2979295982350339.80793069511591-0.344952271055414
34116.5107.6207835211470.3560500977776328.879216478853141.19994015450840
35112.9108.7960802632850.3749855708085064.103919736715070.421988022066659
36102108.0023795876820.349450759817781-6.00237958768213-0.602100114128637
37106109.1546314242050.366654233734571-3.154631424205370.413329357891361
38105.3109.9425999863250.375926629927034-4.642599986325140.216233565197655
39118.8110.0093481000030.3686922251984028.79065189999748-0.157728262228629
40106.1110.3609998361840.368264442911986-4.26099983618425-0.0086377960010636
41109.3108.9180627572430.3201346141313540.381937242756751-0.915032123650648
42117.2108.2489784937810.2929931740147278.95102150621929-0.500264487858976
4392.5109.4459128121500.317924742269318-16.94591281214980.458898932602473
44104.2109.9983290249230.324280203971745-5.798329024923360.119539579511164
45112.5108.6401796146860.2801547188721153.8598203853136-0.860136310712448
46122.4109.9000557701530.30485973485720112.49994422984700.501577874270787
47113.3110.0755762280610.3017148533132483.22442377193928-0.0662506501165228
48100109.2060262067490.273938130054238-9.2060262067488-0.599998337377564
49110.7110.4483175901230.2967250122735250.2516824098770660.495801751623415
50112.8112.8624980849980.347070434402659-0.06249808499815671.08249484577425
51109.8109.8799750419130.265999384561075-0.0799750419126175-1.69792094268066
52117.3112.1356507426380.3158673219980375.164349257361861.01199085651005
53109.1111.8126277355600.299438038773849-2.71262773556041-0.324450755077545
54115.9110.4939366319220.2571323165408355.40606336807807-0.821824416022757
5596110.8414351453850.259506739129008-14.84143514538460.0459592510074398
5699.8109.2329027353120.21071436643755-9.4329027353118-0.951746156028206
57116.8110.122693160560.2282056760226966.677306839440040.346469066656222
58115.7108.3444766965770.177429441639467.35552330342254-1.02451795269354
5999.4104.1609222656280.0688897057410682-4.76092226562805-2.22758842502274
6094.3103.0749195601550.0404780215439526-8.77491956015468-0.589954652290969
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259942693kapxohb7eitp7zq/1i3eq1259942570.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259942693kapxohb7eitp7zq/1i3eq1259942570.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259942693kapxohb7eitp7zq/32r051259942570.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259942693kapxohb7eitp7zq/32r051259942570.ps (open in new window)


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


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