Home » date » 2010 » Dec » 10 »

Blog3

*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, 10 Dec 2010 19:58:02 +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/10/t1292011012tyf3zz8stc9jchp.htm/, Retrieved Fri, 10 Dec 2010 20:56:52 +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/10/t1292011012tyf3zz8stc9jchp.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 «
42.33600 42.14710 40.25640 39.18980 39.13170 38.15070 38.27070 39.13350 40.12190 41.28450 42.57490 43.90190 43.18350 43.61880 44.76240 45.19720 44.38810 43.55520 43.56780 44.21350 45.14510 45.80790 42.32820 37.89990 34.79640 35.21440 36.37270 36.25020 36.82610 36.77230 36.90420 37.04940 36.82590 36.13570 36.03000 35.79270 35.91740 35.40080 35.17230 34.92110 35.02920 34.77390 34.89990 34.90540 34.56800 34.40600 34.45780 34.73160 34.26020 33.88490 34.05490 34.27550 34.13930 34.15870 34.53860 33.79870 33.49730 33.68020 34.32840 34.15380 33.91840 34.32620 34.77500 35.01190 34.55130 34.69510 35.47300 35.97940 36.47890 36.39100 36.67040 37.41620 37.11850 36.30010 35.70020 35.58590 35.67770 35.24080 34.80160 34.43890 34.98810 36.06800 36.35660 36.12540 34.87100 35.21990 34.33900 33.82340 34.51990 35.53000 35.79660 33.84840 33.98710 34.11610 33.82350 32.45400 31.87740 31.11500 31.04360 30.88680 31.30010 30.05070 28.6 etc...
 
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'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
142.33642.336000
242.147142.1754349982682-0.0283349982681699-0.0283349982681699-0.0690720062199077
340.256440.3301585321872-0.0737585321871807-0.0737585321871807-2.12702631200036
439.189839.2871976133781-0.0973976133781213-0.0973976133781214-1.13427192952268
539.131739.2281837154445-0.0964837154445443-0.09648371544454450.0449082970192552
638.150738.1354593226654-0.003810169333653920.0152406773346167-1.34935442656653
738.270738.26548736855520.005212631444792480.005212631444792240.130181099146390
839.133539.11935416702690.0141458329730750.01414583297307490.98644881374596
940.121940.09771030988800.02418969011195620.02418969011195631.12070681919169
1041.284541.24869387844430.03580612155571070.0358061215557111.30960897473060
1142.574942.5169140363312-0.01449649091718880.05798596366875271.53697221355352
1243.901943.85983733401890.04206266598108960.04206266598109051.42534413509020
1343.183543.14647351053330.03702648946672860.0370264894667293-0.876405403784229
1443.618843.57915329011140.03964670988861860.03964670988861940.459005717086123
1544.762444.71553790924560.04686209075444230.04686209075444341.27232121794807
1645.197245.3257372762470.0321343190617536-0.128537276247020.684598777446415
1744.388144.38528975613110.002810243868919270.00281024386892037-1.05187311654929
1843.555243.556446601927-0.00124660192695745-0.00124660192695665-0.963982254050247
1943.567843.568979710131-0.00117971013099891-0.001179710130998110.0159720859088201
2044.213544.21156971156120.001930288438845140.001930288438846200.746185881750455
2145.145145.0857267863623-0.01484330340942820.05937321363770671.04662656695006
2245.807945.80539269233130.002507307668726220.002507307668728000.806945502164552
2342.328242.3390344826571-0.010834482657136-0.0108344826571358-4.01875042277396
2437.899937.9275950379095-0.0276950379095074-0.0276950379095093-5.09815187636318
2534.796434.8357901137023-0.0393901137022745-0.039390113702278-3.54978097681965
2635.214435.0419039441639-0.04312401395903030.1724960558361350.292383387894325
2736.372736.3888326982875-0.0161326982874871-0.01613269828748991.54205611982829
2836.250236.2666693036700-0.0164693036700490-0.0164693036700518-0.122797597770205
2936.826136.8407006308022-0.0146006308022213-0.01460063080222380.683874560576457
3036.772336.7870238992579-0.0147238992578703-0.0147238992578729-0.0452548513316112
3136.904236.8418071860854-0.01559820347863840.06239281391456360.082368161679674
3237.049437.0611259458685-0.0117259458684654-0.01172594586846780.262335511197369
3336.825936.8381967654176-0.0122967654176189-0.0122967654176214-0.244543796890893
3436.135736.1498190859287-0.0141190859287129-0.0141190859287159-0.782804266559144
3536.0336.0443646111659-0.0143646111659006-0.0143646111659036-0.105752835567033
3635.792735.7473652959147-0.01133367602131330.0453347040852663-0.333745842672942
3735.917435.9260131764210-0.0086131764210399-0.00861317642104310.213175199160961
3835.400835.4106056337465-0.00980563374654099-0.00980563374654458-0.58669462035019
3935.172335.1826177985358-0.0103177985357711-0.0103177985357748-0.252579704308682
4034.921134.9319806074145-0.0108806074144817-0.0108806074144857-0.278206170139057
4135.029234.9833504507029-0.01146238732426980.04584954929709490.073313186079764
4234.773934.7876939582631-0.0137939582630737-0.0137939582630777-0.207433780394040
4334.899934.9134033263347-0.0135033263346902-0.01350332633469410.161475439642412
4434.905434.9188639003467-0.0134639003466439-0.01346390034664780.0219507133518113
4534.56834.5821345754978-0.0141345754978107-0.0141345754978149-0.374178901412724
4634.40634.3564689381184-0.01238276547039130.0495310618815827-0.248611291692362
4734.457834.4687685980807-0.0109685980807150-0.01096859808071940.140814289058293
4834.731634.7420373133852-0.0104373133852268-0.01043731338523090.32897022088489
4934.260234.2714957168946-0.0112957168945674-0.0112957168945720-0.532513984239502
5033.884933.8968723047783-0.0119723047783055-0.0119723047783104-0.42050628564687
5134.054934.0034841157504-0.01285397106240590.05141588424964240.139142645752838
5234.275534.2853262711457-0.0098262711457204-0.00982627114572490.333589568509462
5334.139334.1493401014813-0.0100401014813066-0.0100401014813112-0.146002085277924
5434.158734.1686903715804-0.00999037158036111-0.009990371580365720.0340127841374934
5534.538634.547932883604-0.00933288360401597-0.009332883604020130.45044939718966
5633.798733.7817883416114-0.004227914597145280.0169116583886022-0.886827406835394
5733.497333.504095658889-0.00679565888896662-0.00679565888897212-0.310140884005287
5833.680233.6867020123593-0.00650201235929028-0.006502012359295550.219174984097073
5934.328434.3338901081709-0.00549010817090561-0.005490108170910090.756445750594122
6034.153834.1595510802252-0.00575108022521263-0.00575108022521731-0.195390589058263
6133.918433.9016222892184-0.004194427695396340.0167777107816057-0.295170688122443
6234.326234.3266832857126-0.000483285712594828-0.0004832857125994960.487595146530007
6334.77534.77484236804620.0001576319538035720.0001576319537994890.519134947841041
6435.011935.01140512820690.0004948717931504270.0004948717931466560.273549820008466
6534.551334.5514610241815-0.000161024181514142-0.00016102418151853-0.532784005673423
6634.695134.6912702364525-0.0009574408868670860.003829763547484940.163678814922834
6735.47335.46772980134160.005270198658432640.005270198658429310.88426031140884
6835.979435.97346693123610.005933068763882990.005933068763880360.579072313984052
6936.478936.47231492736610.006585072633951130.006585072633949210.570333662555418
7036.39136.38453957785720.006460422142751770.00646042214274971-0.109180865127905
7136.670436.68993178288400.00488294572101047-0.01953178288403590.349283413677853
7237.416237.40600962966040.01019037033961220.01019037033961150.809870478658174
7337.118537.10868927253270.0098107274673420.00981072746734083-0.355793640670887
7436.300136.29130923647970.008790763520331250.00879076352032881-0.957069016655067
7535.700235.69215793360350.008042066396482340.00804206639647896-0.703395274827105
7635.585935.61965343777740.00843835944435643-0.0337534377774116-0.0940478766329062
7735.677735.66897606938880.008723930611183090.00872393061117960.0466034876406184
7835.240835.23259064667440.00820935332555660.0082093533255524-0.514976730637595
7934.801634.79390668975640.007693310243591990.00769331024358705-0.517040364796021
8034.438934.43163341015870.007266589841288040.00726658984128249-0.428038480215796
8134.988135.00669999994860.00464999998714276-0.01859999994855360.662569821814272
8236.06836.05648913046540.01151086953462990.01151086953462691.19238897480090
8336.356636.3447882736470.01181172635301140.01181172635300890.320223781243564
8436.125436.11385184384840.01154815615159250.0115481561515895-0.280841690321558
8534.87134.86082340197710.01017659802288570.0101765980228805-1.46302087756877
8635.219935.25396773154070.00851693288517614-0.03406773154068720.446646691128553
8734.33934.33621846154540.002781538454567870.00278153845456227-1.05758951860822
8833.823433.82114959016960.002250409830433470.00225040983042692-0.599096687508627
8934.519934.51693899693680.002961003063218630.002961003063213360.80234888250385
9035.5335.5260092024640.003990797536038030.003990797536034641.16395786680534
9135.796635.80801488930790.00285372232698653-0.01141488930793520.324087151269594
9233.848433.8569947572612-0.00859475726114858-0.00859475726115417-2.23243263379413
9333.987133.9955518913476-0.0084518913475583-0.00845189134756360.170234101089905
9434.116134.1244187015307-0.00831870153067683-0.008318701530681860.158858404795086
9533.823533.8320939012381-0.00859390123812694-0.00859390123813253-0.328554917264523
9632.45432.4410371782952-0.003240705426186060.0129628217047803-1.61087201631425
9731.877431.8837217511378-0.00632175113782064-0.0063217511378305-0.633460440698992
9831.11531.1220179557853-0.00701795578529623-0.00701795578530763-0.873849604103909
9931.043631.0506771848967-0.00707718489667595-0.00707718489668748-0.0744106152827217
10030.886830.8940147977779-0.00721479777789522-0.00721479777790706-0.173044699715184
10131.300131.2656692029748-0.008607699256291130.03443079702520800.441295385732062
10230.050730.0656116666347-0.0149116666346762-0.014911666634689-1.36291779855194
10328.679928.6959999999655-0.0160999999654886-0.0160999999655043-1.56712457252792
10427.643827.6607931698410-0.0169931698410127-0.0169931698410305-1.17890805504039
10527.239427.2567321084494-0.0173321084493499-0.0173321084493686-0.4477619683689
10626.854926.7918366696757-0.01576583258104780.063063330324271-0.5211264212921
10727.015827.0302830125227-0.0144830125226532-0.01448301252267270.290944503000938
10826.918826.9333520066592-0.0145520066591987-0.0145520066592184-0.095374378357103
10926.496626.5114925647148-0.0148925647147603-0.0148925647147809-0.471165862111062
11026.78526.7996393989685-0.0146393989684372-0.01463939896845710.350550364352526
11126.839826.7812919276302-0.01462701809243630.0585080723698248-0.00431617583572449
11226.447826.4638873599685-0.0160873599685169-0.0160873599685374-0.346687060303721
11325.172825.1898936850186-0.017093685018531-0.0170936850185544-1.45509697808214
11424.878424.8957151756850-0.017315175685016-0.0173151756850401-0.320520818536446
11525.401525.4183838786582-0.0168838786581772-0.01688387865820000.624631897486044
11625.771625.7002496455275-0.01783758861809690.07135035447247520.347642342186239
11726.118126.1338524137636-0.0157524137635734-0.01575241376359440.517127090355379
11826.396926.4124268759281-0.0155268759280364-0.01552687592805680.340460118845051
11926.657126.6724159142789-0.0153159142789076-0.01531591427892720.318700604984224
12025.183925.2003305045564-0.0164305045564241-0.0164305045564473-1.68510477822649
12123.839423.7907199396669-0.01217001508324230.0486800603330799-1.62075497610086
12223.861923.8736486029201-0.0117486029200313-0.01174860292005870.108978106233011
12324.258124.2695488611110-0.0114488611109307-0.01144886111095710.471537063720573
12425.109825.1206151247970-0.0108151247970110-0.01081512479703520.997691342666033
12526.161726.1717354365191-0.0100354365190306-0.01003543651905211.22836513292013
12626.808726.7615171139343-0.01179572151641570.04718288606574090.697626631317971
12725.657725.6740761837173-0.0163761837172688-0.0163761837172905-1.23307189753489
12827.098227.1135473163577-0.0153473163576667-0.01534731635768451.68398892136697
12927.466527.4815765701928-0.0150765701927448-0.01507657019276150.443454288556823
13028.28928.3034858956027-0.0144858956026562-0.01448589560267070.968147042093065
13128.693328.6314919108446-0.01545202228884640.0618080891554390.398250905421869
13227.240127.2611050339787-0.0210050339786566-0.0210050339786728-1.55374796972025
13327.279827.3007637661106-0.0209637661106230-0.02096376611063900.0701692816639394
13427.640427.6611045515960-0.0207045515960337-0.02070455159604860.441051751541412
13526.83126.852239986387-0.0212399863869989-0.0212399863870161-0.91165781480543
13626.246726.1689315649363-0.01944210876591090.0777684350637214-0.76969532962713
13725.221225.2442179016024-0.0230179016024234-0.0230179016024448-1.03842076522797
13825.365325.3882083879056-0.0229083879056121-0.02290838790563310.193174867004826
13926.259226.2815079894862-0.0223079894862055-0.02230798948622381.05975706211745
14027.227927.2495594240491-0.0216594240491006-0.0216594240491161.14552610396128
14126.331526.2550492229190-0.01911269427023730.0764507770810251-1.13078019658552
14225.898125.9184230379432-0.0203230379432188-0.0203230379432385-0.364317169491147
14326.689826.7096094243843-0.0198094243842789-0.01980942438429620.938644095027547
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/1m5fk1292011077.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/1m5fk1292011077.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/2m5fk1292011077.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/2m5fk1292011077.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/3eee51292011077.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/3eee51292011077.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/475e81292011077.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/475e81292011077.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/575e81292011077.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292011012tyf3zz8stc9jchp/575e81292011077.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 <- 5
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