Last data update: 2014.03.03

R: TimeSeries averages over cycle phases.
avgtsR Documentation

TimeSeries averages over cycle phases.

Description

This function returns the averages of the input time series over each of phases in the Dating. It omits the NA's in the time series, so will give an error with internal NA's.

Usage

avgts(ts,Dating) 

Arguments

ts

The input time series.

Dating

The dating.

Value

A ts timeseries.

Author(s)

Majid Einian,m.einian@mbri.ac.ir,
Monetary and Banking Research Institute, Central Bank of Islamic Republic of Iran

Examples

data("Iran.non.Oil.GDP.Quarterly.Growth")
data("MBRI.Iran.Dating")
avggrowth <- avgts(Iran.non.Oil.GDP.Quarterly.Growth,MBRI.Iran.Dating)
cbind(avggrowth,Iran.non.Oil.GDP.Quarterly.Growth)
plot(MBRI.Iran.Dating,avggrowth)
plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Quarterly.Growth,averages=TRUE)









Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BCDating)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BCDating/avgts.Rd_%03d_medium.png", width=480, height=480)
> ### Name: avgts
> ### Title: TimeSeries averages over cycle phases.
> ### Aliases: avgts
> ### Keywords: Averages over Cycle Phases
> 
> ### ** Examples
> 
> data("Iran.non.Oil.GDP.Quarterly.Growth")
> data("MBRI.Iran.Dating")
> avggrowth <- avgts(Iran.non.Oil.GDP.Quarterly.Growth,MBRI.Iran.Dating)
Warning message:
In window.default(x, ...) : 'start' value not changed
> cbind(avggrowth,Iran.non.Oil.GDP.Quarterly.Growth)
         avggrowth Iran.non.Oil.GDP.Quarterly.Growth
1367 Q2  0.1646207                       -4.07094167
1367 Q3  0.1646207                        2.79743640
1367 Q4  0.1646207                        1.74877726
1368 Q1  0.1646207                       -1.56021883
1368 Q2  0.1646207                        1.90805046
1368 Q3  3.0723742                        2.83623375
1368 Q4  3.0723742                       10.88055401
1369 Q1  3.0723742                       -1.33164518
1369 Q2  3.0723742                        1.91343779
1369 Q3  3.0723742                        2.41133835
1369 Q4  3.0723742                        6.33867469
1370 Q1  3.0723742                        2.22078677
1370 Q2  3.0723742                       -0.80004894
1370 Q3  3.0723742                        7.33667194
1370 Q4  3.0723742                       -1.08226147
1371 Q1 -0.1249312                        2.01249576
1371 Q2 -0.1249312                        0.74387567
1371 Q3 -0.1249312                       -1.03329087
1371 Q4 -0.1249312                        0.36154041
1372 Q1 -0.1249312                        4.62375750
1372 Q2 -0.1249312                       -1.18687452
1372 Q3 -0.1249312                       -5.21039588
1372 Q4 -0.1249312                       -1.31055745
1373 Q1  4.6276715                        3.42239899
1373 Q2  4.6276715                        5.83294395
1373 Q3 -1.6406151                       -3.16349017
1373 Q4 -1.6406151                       -1.28602385
1374 Q1 -1.6406151                       -0.47233141
1374 Q2  2.0312814                        4.10462371
1374 Q3  2.0312814                        2.40468963
1374 Q4  2.0312814                        2.43551769
1375 Q1  2.0312814                        0.08929058
1375 Q2  2.0312814                        1.30854328
1375 Q3  2.0312814                        2.23719282
1375 Q4  2.0312814                        3.15040037
1376 Q1  2.0312814                        0.51999316
1376 Q2  0.3255936                        0.33110286
1376 Q3  0.3255936                       -0.08497805
1376 Q4  0.3255936                       -0.76748236
1377 Q1  0.3255936                        2.11162062
1377 Q2  0.3255936                        1.04099119
1377 Q3  0.3255936                        0.22974703
1377 Q4  0.3255936                        2.09543608
1378 Q1  0.3255936                       -2.35168843
1378 Q2  2.1903880                       -0.22428976
1378 Q3  2.1903880                        7.38289253
1378 Q4  2.1903880                       -0.58743873
1379 Q1  0.7194446                       -1.00341692
1379 Q2  0.7194446                        0.33015297
1379 Q3  0.7194446                        3.67624217
1379 Q4  0.7194446                        1.63602956
1380 Q1  0.7194446                       -1.04178481
1380 Q2  2.8355018                        1.96191798
1380 Q3  2.8355018                        3.26074152
1380 Q4  2.8355018                        1.17710831
1381 Q1  2.8355018                        4.94223947
1381 Q2 -0.3786906                        0.34989424
1381 Q3 -0.3786906                       -1.10727547
1381 Q4  2.1878597                        3.44407139
1382 Q1  2.1878597                        2.87750051
1382 Q2  2.1878597                        0.56665430
1382 Q3  2.1878597                        1.34200651
1382 Q4  2.1878597                        2.09677232
1383 Q1  2.1878597                        2.80015337
1383 Q2  1.0961086                        2.74364688
1383 Q3  1.0961086                       -3.23034491
1383 Q4  1.0961086                        3.77502377
1384 Q1  1.9650074                        2.73578050
1384 Q2  1.9650074                        0.81824872
1384 Q3  1.9650074                        0.43754297
1384 Q4  1.9650074                        8.62921485
1385 Q1  1.9650074                       -1.15891687
1385 Q2  1.9650074                       -0.04739545
1385 Q3  1.9650074                        1.97239689
1385 Q4  1.9650074                        1.60749059
1386 Q1  1.9650074                        2.69070472
1386 Q2  0.5545760                        2.52272518
1386 Q3  0.5545760                       -2.12831844
1386 Q4  0.5545760                       -1.48936698
1387 Q1  0.5545760                        1.02509471
1387 Q2  0.5545760                        0.08737624
1387 Q3  0.5545760                        2.87424224
1387 Q4  0.5545760                        0.82187874
1388 Q1  0.5545760                        0.15056377
1388 Q2  0.5545760                        1.12698894
1388 Q3  1.3656560                        0.06197057
1388 Q4  1.3656560                        2.16478316
1389 Q1  1.3656560                        2.60815232
1389 Q2  1.3656560                        0.87340882
1389 Q3  1.3656560                        1.69583785
1389 Q4  1.3656560                       -0.25886984
1390 Q1  1.3656560                        2.31473073
1390 Q2  1.3656560                        1.46523458
1390 Q3 -0.3958642                       -1.13869382
1390 Q4 -0.3958642                        1.83503734
1391 Q1 -0.3958642                       -4.19443130
1391 Q2 -0.3958642                        1.20245395
1391 Q3 -0.3958642                        0.25951440
1391 Q4 -0.3958642                        0.93121080
1392 Q1 -0.3958642                       -3.14354343
1392 Q2 -0.3958642                        1.08153846
1392 Q3  0.3103320                        0.51272228
1392 Q4  0.3103320                        0.10794176
1393 Q1         NA                        2.25373401
> plot(MBRI.Iran.Dating,avggrowth)
> plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Quarterly.Growth,averages=TRUE)
Warning messages:
1: In .local(x, y, ...) :
  BCDating: Plotting Averages only in windowed mode
2: In window.default(x, ...) : 'start' value not changed
3: In window.default(x, ...) : 'start' value not changed
4: In window.default(x, ...) : 'start' value not changed
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>