Description Usage Arguments Details Value
View source: R/zchunk_L102.GDP.R
When we have to join two GDP time series, we usually find that they don't match up at year of overlap (the "base year"). What we do in these cases is we compute, for the later time series, ratios of GDPs in the future years to those in the base year. We then multiply the future ratios by the past base year value. That future time series can then be grafted onto the past without leaving a seam.
1 | join.gdp.ts(past, future, grouping)
|
past |
Tibble with the past time series (year, gdp, and grouping). |
future |
Tibble with the future data (year, gdp, scenario, and grouping). |
grouping |
Name of the grouping column (generally either 'iso' or 'GCAM_region_ID', but could be anything |
In practice, the past is often a single time series, while the future is often a collection of scenarios. Therefore, we assume that the past time series has no scenario column. If the future does not have a scenario column, it is given a dummy one, which is dropped before the new table is returned. Note that we look for lower-case 'scenario' for this.
The base year is calculated automatically. It is the maximum of the years that overlap between the two data sets.
We also have to know how to group the data for calculating the gdp ratios. Normally this will be either by country ('iso') or by GCAM region ('GCAM_region_ID'). The choice of which is passed in as the 'grouping' argument.
Finally, although we have discussed this function in terms of joining two GDP
time series, in the future time series we use only the ratios of GDP to base
year GDP. Therefore, any time series with the correct ratios will work. For
example, if we have a time series of growth rates, we can convert those to
ratios using cumprod
and pass those ratios as the future
time series. For similar reasons, even if the two time series have different
units (e.g., different dollar-years or PPP vs. MER), they can still be
joined. The units of the output time series will be the same as the units of
past
.
Time series with the past and future joined as described in details.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.