Home » date » 2009 » Jun » 02 »

Opgave 9, oefening 1, Stap 1, Sara Vandenberghe, de juiste versie

*Unverified author*
R Software Module: rwasp_decomposeloess.wasp (opens new window with default values)
Title produced by software: Decomposition by Loess
Date of computation: Tue, 02 Jun 2009 01:26:59 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe.htm/, Retrieved Tue, 02 Jun 2009 09:27:52 +0200
 
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/Jun/02/t1243927666ll5uuz0j4affhhe.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 «
41086 39690 43129 37863 35953 29133 24693 22205 21725 27192 21790 13253 37702 30364 32609 30212 29965 28352 25814 22414 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 20366 22782 19169 13807 29743 25591 29096 26482 22405 27044 17970 18730 19684 19785 18479 10698
 
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


Seasonal Decomposition by Loess - Parameters
ComponentWindowDegreeJump
Seasonal721073
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
14108639765.58775206228016.0417788291134390.3704691087-1320.41224793783
23969040483.61591669655307.4567123640833588.9273709394793.615916696486
34312944904.81154250918565.7041847207132787.48427277021775.81154250913
43786338041.88850828535665.2961531063432018.8153386084178.888508285268
53595339374.96780605361280.8857894997431250.14640444663421.96780605364
62913326945.6209875880803.41922216653830516.9597902454-2187.37901241197
72469322954.6053756259-3352.3785516701329783.7731760442-1738.39462437410
82220521012.5446188337-5652.5667871242829050.0221682906-1192.45538116634
92172519296.3142029408-4162.5853634777928316.2711605370-2428.68579705923
102719226702.3207129158-2.7695853105046427684.4488723947-489.679287084222
112179021649.9964985952-5122.623082847627052.6265842524-140.003501404826
121325311005.7402153704-11345.878437580526846.1382222102-2247.25978462961
133770240748.3083610038016.0417788291126639.64986016793046.30836100299
143036428755.96756130275307.4567123640826664.5757263332-1608.03243869726
153260929962.79422278088565.7041847207126689.5015924984-2646.20577721916
163021228007.01658791385665.2961531063426751.6872589799-2204.9834120862
172996531835.2412850391280.8857894997426813.87292546131870.241285039
182835228984.8872877684803.41922216653826915.6934900651632.887287768386
192581427962.8644970013-3352.3785516701327017.51405466892148.86449700125
202241423289.939069944-5652.5667871242827190.6277171803875.939069944005
212050617810.8439837861-4162.5853634777927363.7413796917-2695.15601621388
222880630170.7731880218-2.7695853105046427443.99639728871364.77318802182
232222822054.3716679619-5122.623082847627524.2514148857-173.628332038101
241397111928.2861887096-11345.878437580527359.5922488709-2042.71381129037
253684538479.02513831488016.0417788291127194.93308285611634.02513831475
263533838422.20938307005307.4567123640826946.33390456593084.20938307004
273502234780.56108900378565.7041847207126697.7347262756-241.438910996323
283477737487.78645457945665.2961531063426400.91739231422710.78645457942
292688726389.01415214741280.8857894997426104.1000583529-497.9858478526
302397021444.3240703537803.41922216653825692.2567074797-2525.67592964626
312278023631.9651950636-3352.3785516701325280.4133566066851.965195063556
321735115586.6767269591-5652.5667871242824767.8900601652-1764.32327304094
332138222671.2185997539-4162.5853634777924255.36676372391289.21859975392
342456125328.0179503678-2.7695853105046423796.7516349427767.01795036778
351740916602.4865766860-5122.623082847623338.1365061616-806.513423313969
361151411284.6111677483-11345.878437580523089.2672698323-229.388832251727
373151432171.56018766798016.0417788291122840.398033503657.560187667907
382707126049.59412213775307.4567123640822784.9491654982-1021.40587786227
392946227628.79551778598565.7041847207122729.5002974934-1833.20448221411
402610523738.839187435665.2961531063422805.8646594637-2366.16081257002
412239720630.88518906631280.8857894997422882.2290214340-1766.11481093370
422384323853.5358689037803.41922216653823029.044908929810.5358689036875
432170523586.5177552445-3352.3785516701323175.86079642561881.51775524455
441808918405.6288275960-5652.5667871242823424.9379595283316.628827595952
452076422016.5702408467-4162.5853634777923674.01512263111252.57024084672
462531626712.4449074679-2.7695853105046423922.32467784261396.44490746794
471770416359.9888497936-5122.623082847624170.6342330540-1344.01115020644
481554818246.044990641-11345.878437580524195.83344693952698.04499064101
492802923820.92556034588016.0417788291124221.0326608250-4208.07443965416
502938329357.66191724785307.4567123640824100.8813703881-25.3380827521505
513643840329.56573532828565.7041847207123980.73007995113891.5657353282
523203434500.63761600785665.2961531063423902.06623088592466.63761600781
532267920253.71182867971280.8857894997423823.4023818206-2425.28817132035
542431924089.7381878047803.41922216653823744.8425900287-229.261812195284
551800415694.0957534333-3352.3785516701323666.2827982369-2309.90424656674
561753717284.0365297475-5652.5667871242823442.5302573768-252.963470252518
572036621675.8076469611-4162.5853634777923218.77771651671309.80764696106
582278222601.6558894239-2.7695853105046422965.1136958866-180.344110576123
591916920749.1734075911-5122.623082847622711.44967525651580.17340759108
601380716311.7423297352-11345.878437580522648.13610784532504.74232973524
612974328885.13568073688016.0417788291122584.8225404341-857.864319263212
622559123315.31817469605307.4567123640822559.2251129399-2275.68182530402
632909627092.66812983358565.7041847207122533.6276854458-2003.33187016649
642648224788.72952324355665.2961531063422509.9743236502-1693.27047675652
652240521042.79324864571280.8857894997422486.3209618546-1362.20675135432
662704430815.0152992919803.41922216653822469.56547854153771.01529929193
671797016839.5685564417-3352.3785516701322452.8099952285-1130.43144355834
681873020648.9163639743-5652.5667871242822463.650423151918.91636397429
691968421056.0945124063-4162.5853634777922474.49085107151372.09451240629
701978517073.1635633569-2.7695853105046422499.6060219537-2711.83643664315
711847919555.9018900118-5122.623082847622524.72119283581076.9018900118
721069810189.5107696766-11345.878437580522552.3676679039-508.489230323401
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/1d6oq1243927617.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/1d6oq1243927617.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/2xjav1243927617.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/2xjav1243927617.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/3tiaf1243927617.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/3tiaf1243927617.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/4rphp1243927617.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/02/t1243927666ll5uuz0j4affhhe/4rphp1243927617.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1) #seasonal period
if (par2 != 'periodic') par2 <- as.numeric(par2) #s.window
par3 <- as.numeric(par3) #s.degree
if (par4 == '') par4 <- NULL else par4 <- as.numeric(par4)#t.window
par5 <- as.numeric(par5)#t.degree
if (par6 != '') par6 <- as.numeric(par6)#l.window
par7 <- as.numeric(par7)#l.degree
if (par8 == 'FALSE') par8 <- FALSE else par9 <- TRUE #robust
nx <- length(x)
x <- ts(x,frequency=par1)
if (par6 != '') {
m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.window=par6, l.degree=par7, robust=par8)
} else {
m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.degree=par7, robust=par8)
}
m$time.series
m$win
m$deg
m$jump
m$inner
m$outer
bitmap(file='test1.png')
plot(m,main=main)
dev.off()
mylagmax <- nx/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(as.numeric(m$time.series[,'trend']),na.action=na.pass,lag.max = mylagmax,main='Trend')
acf(as.numeric(m$time.series[,'seasonal']),na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(as.numeric(m$time.series[,'remainder']),na.action=na.pass,lag.max = mylagmax,main='Remainder')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Seasonal Decomposition by Loess - Parameters',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Component',header=TRUE)
a<-table.element(a,'Window',header=TRUE)
a<-table.element(a,'Degree',header=TRUE)
a<-table.element(a,'Jump',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,m$win['s'])
a<-table.element(a,m$deg['s'])
a<-table.element(a,m$jump['s'])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,m$win['t'])
a<-table.element(a,m$deg['t'])
a<-table.element(a,m$jump['t'])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Low-pass',header=TRUE)
a<-table.element(a,m$win['l'])
a<-table.element(a,m$deg['l'])
a<-table.element(a,m$jump['l'])
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Seasonal Decomposition by Loess - Time Series Components',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,'Fitted',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,'Remainder',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,x[i]+m$time.series[i,'remainder'])
a<-table.element(a,m$time.series[i,'seasonal'])
a<-table.element(a,m$time.series[i,'trend'])
a<-table.element(a,m$time.series[i,'remainder'])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.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