Home » date » 2009 » Dec » 04 »

Ad hoc forecasting

*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:16:16 -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/t1259943425zhfhxozgvk02vc2.htm/, Retrieved Fri, 04 Dec 2009 17:17:12 +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/t1259943425zhfhxozgvk02vc2.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:
Techniek 3: Structurele tijdreeksanalyse
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
462 455 461 461 463 462 456 455 456 472 472 471 465 459 465 468 467 463 460 462 461 476 476 471 453 443 442 444 438 427 424 416 406 431 434 418 412 404 409 412 406 398 397 385 390 413 413 401 397 397 409 419 424 428 430 424 433 456 459 446 441
 
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
1462462000
2455460.646062194394-1.8205545052069-5.6460621943938-1.88009699361182
3461457.698526489489-2.463982029708953.30147351051124-0.300541729252562
4461458.038149306611-1.082170447842292.961850693388540.760951405976302
5463460.518870543420.804859042713312.481129456579751.00045279284430
6462462.1862394548181.25791568112083-0.1862394548176060.221881565374327
7456459.113566745741-0.956600442788405-3.113566745741-1.08772338491657
8455455.481012059443-2.32140545865447-0.481012059443217-0.678839082309205
9456454.16505406102-1.805797378856441.834945938980280.256269279788715
10472463.5395203644083.941640334042178.460479635591722.84992772467317
11472471.6370738651016.07854568725930.3629261348986891.05939867949850
12471474.3434247972124.34511588607999-3.34342479721242-0.859560870115967
13465470.7661535458380.301071492224929-5.76615354583835-2.01658089000833
14459466.558795673856-2.0136840651849-7.55879567385617-1.16715765892350
15465463.695204304106-2.447252724285141.30479569589388-0.213843572045822
16468464.497281638015-0.8342238860418913.502718361984600.79560261036034
17467464.101773392619-0.616654344940832.898226607380790.109751571825025
18463461.225336970294-1.751092741905091.77466302970630-0.568265461506125
19460460.116972466473-1.42936849750847-0.1169724664729440.158858310157211
20462462.2433836567320.336243651513575-0.2433836567321730.871853394779848
21461464.9972580448971.53463471638924-3.997258044896880.594217921302161
22476468.6789908070562.600765895122967.321009192944210.529129019599888
23476472.603376586083.258523098923953.396623413920340.326427002763428
24471472.556042362251.61585319806942-1.55604236224991-0.815926387932145
25453463.628592620051-3.62874854372475-10.6285926200509-2.60872157477873
26443453.321331507414-6.95540308874441-10.3213315074138-1.65197748224769
27442443.122170478797-8.56488737997111-1.12217047879715-0.795516256087589
28444437.184225183589-7.271136219264536.815774816411220.640253122798788
29438432.254846723312-6.119513945344285.745153276687960.573898753201987
30427426.095239336167-6.139323028115330.90476066383294-0.00988371827844293
31424423.586786365758-4.342149573319810.4132136342415090.891808473602591
32416419.342418395631-4.29391262760153-3.342418395631330.0238493873240153
33406413.562856158462-5.02407688832217-7.56285615846179-0.361329735448834
34431417.720852566978-0.51677936108938113.27914743302202.23570451393841
35434424.4512400956453.043018999158439.548759904355461.76865048079695
36418420.058123373997-0.614830305087467-2.05812337399695-1.81849994368634
37412417.898644517389-1.37569205497466-5.89864451738943-0.377953358643656
38404414.327836738978-2.45664512352714-10.3278367389777-0.535701299659597
39409411.462572617259-2.65725230759588-2.46257261725884-0.099239103774605
40412407.187632715771-3.448540324747324.81236728422908-0.392024162503858
41406401.504105993392-4.541097661412684.49589400660847-0.543213720409086
42398397.378018517602-4.337724257672090.6219814823980460.101239213113608
43397394.929060723711-3.41057597209092.070939276289290.46037296599645
44385390.592273491547-3.86455274448964-5.59227349154697-0.224747195555188
45390396.4728043491630.897024483350892-6.4728043491632.35628153175414
46413401.61708807992.9681316906377311.38291192010021.02682414250941
47413402.1734894465691.7918508401902410.8265105534313-0.58440508276701
48401402.5420264413941.09655136965589-1.54202644139356-0.345655368645654
49397402.4384084005770.509537602754697-5.43840840057749-0.291453933195374
50397405.0231139163451.52390113926468-8.023113916344870.502570517538001
51409408.7981065225282.621587591273330.2018934774715500.543311934737619
52419412.3441821376423.071320631048076.655817862357690.222886485032896
53424417.7396532325244.201599192026226.260346767476030.56148364593677
54428425.7041686833426.03454519653372.295831316657580.911356616111277
55430430.7111369713795.53335850397997-0.711136971378974-0.248819626196394
56424435.5452245972565.19257503695732-11.5452245972563-0.168814523671046
57433440.8978785096315.27040682539327-7.897878509630660.0385307652333583
58456444.2838295416694.3558411069109911.7161704583307-0.453358404700734
59459447.4227248357393.7652512062800311.5772751642615-0.293295964734837
60446448.6158928813232.51538326538021-2.61589288132271-0.621076433301036
61441448.7622881211561.36302900914963-7.76228812115596-0.571992137434703
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259943425zhfhxozgvk02vc2/16htf1259943374.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259943425zhfhxozgvk02vc2/16htf1259943374.ps (open in new window)


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


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


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


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