benchmarking {gseries} | R Documentation |
Restore temporal constraints
Description
(version française: https://StatCan.github.io/gensol-gseries/fr/reference/benchmarking.html)
Replication of the G-Series 2.0 SAS^\circledR
BENCHMARKING procedure (PROC BENCHMARKING).
See the G-Series 2.0 documentation for details (Statistics Canada 2016).
This function ensures coherence between time series data of the same target variable measured at different frequencies (e.g., sub-annually and annually). Benchmarking consists of imposing the level of the benchmark series (e.g., annual data) while minimizing the revisions of the observed movement in the indicator series (e.g., sub-annual data) as much as possible. The function also allows nonbinding benchmarking where the benchmark series can also be revised.
The function may also be used for benchmarking-related topics such as temporal distribution (the reciprocal action of benchmarking: disaggregation of the benchmark series into more frequent observations), calendarization (a special case of temporal distribution) and linking (the connection of different time series segments into a single consistent time series).
Several series can be benchmarked in a single function call.
Usage
benchmarking(
series_df,
benchmarks_df,
rho,
lambda,
biasOption,
bias = NA,
tolV = 0.001,
tolP = NA,
warnNegResult = TRUE,
tolN = -0.001,
var = "value",
with = NULL,
by = NULL,
verbose = FALSE,
# New in G-Series 3.0
constant = 0,
negInput_option = 0,
allCols = FALSE,
quiet = FALSE
)
Arguments
series_df |
(mandatory) Data frame (object of class "data.frame") that contains the indicator time series data to be
benchmarked. In addition to the series data variable(s), specified with argument |
benchmarks_df |
(mandatory) Data frame (object of class "data.frame") that contains the benchmarks. In addition to the benchmarks
data variable(s), specified with argument |
rho |
(mandatory) Real number in the |
lambda |
(mandatory) Real number, with suggested values in the |
biasOption |
(mandatory) Specification of the bias estimation option:
Argument |
bias |
(optional) Real number, or Default value is |
tolV , tolP |
(optional) Nonnegative real number, or Example: to set a tolerance of 10 units, specify Default values are |
warnNegResult |
(optional) Logical argument specifying whether a warning message is generated when a negative value created by the
function in the benchmarked (output) series is smaller than the threshold specified by argument Default value is |
tolN |
(optional) Negative real number specifying the threshold for the identification of negative values. A value is considered negative when it is smaller than this threshold. Default value is |
var |
(optional) String vector (minimum length of 1) specifying the variable name(s) in the indicator series data frame
(argument The syntax is Example: Default value is |
with |
(optional) String vector (same length as argument The syntax is Example: Default value is |
by |
(optional) String vector (minimum length of 1), or Default value is |
verbose |
(optional) Logical argument specifying whether information on intermediate steps with execution time (real time,
not CPU time) should be displayed. Note that specifying argument Default value is |
constant |
(optional) Real number that specifies a value to be temporarily added to both the indicator series and the
benchmarks before solving proportional benchmarking problems ( Default value is |
negInput_option |
(optional) Handling of negative values in the input data for proportional benchmarking (
Default value is |
allCols |
(optional) Logical argument specifying whether all variables in the indicator series data frame (argument Default value is |
quiet |
(optional) Logical argument specifying whether or not to display only essential information such as warning messages,
error messages and variable (series) or BY-group information when multiple series are benchmarked in a single call
to the function. We advise against wrapping your Default value is |
Details
When \rho < 1
, this function returns the generalized least squared solution of a special case of the general
regression-based benchmarking model proposed by Dagum and Cholette (2006). The model, in matrix form, is:
\displaystyle
\begin{bmatrix} s^\dagger \\ a \end{bmatrix} =
\begin{bmatrix} I \\ J \end{bmatrix} \theta +
\begin{bmatrix} e \\ \varepsilon \end{bmatrix}
where
-
a
is the vector of lengthM
of the benchmarks. -
s^\dagger = \left\{ \begin{array}{cl} s + b & \text{if } \lambda = 0 \\ s \cdot b & \text{otherwise} \end{array} \right.
is the vector of lengthT
of the bias corrected indicator series values, withs
denoting the initial (input) indicator series. -
b
is the bias, which is specified with argumentbias
when argumentbias_option != 3
or, whenbias_option = 3
, is estimated as\hat{b} = \left\{ \begin{array}{cl} \frac{{1_M}^\mathrm{T} (a - Js)}{{1_M}^\mathrm{T} J 1_T} & \text{if } \lambda = 0 \\ \frac{{1_M}^\mathrm{T} a}{{1_M}^\mathrm{T} Js} & \text{otherwise} \end{array} \right.
, where1_X = (1, ..., 1)^\mathrm{T}
is a vector of1
of lengthX
. -
J
is theM \times T
matrix of temporal aggregation constraints with elementsj_{m, t} = \left\{ \begin{array}{cl} 1 & \text{if benchmark } m \text{ covers period } t \\ 0 & \text{otherwise} \end{array} \right.
. -
\theta
is the vector of the final (benchmarked) series values. -
e \sim \left( 0, V_e \right)
is the vector of the measurement errors ofs^\dagger
with covariance matrixV_e = C \Omega_e C
. -
C = \mathrm{diag} \left( \sqrt{c_{s^\dagger}} \left| s^\dagger \right|^\lambda \right)
wherec_{s^\dagger}
is the vector of the alterability coefficients ofs^\dagger
, assuming0^0 = 1
. -
\Omega_e
is aT \times T
matrix with elements\omega_{e_{i,j}} = \rho^{|i-j|}
representing the autocorrelation of an AR(1) process, again assuming0^0 = 1
. -
\varepsilon \sim (0, V_\varepsilon)
is the vector of the measurement errors of the benchmarksa
with covariance matrixV_\varepsilon = \mathrm{diag} \left( c_a a \right)
wherec_a
is the vector of the alterability coefficients of the benchmarksa
.
The generalized least squared solution is:
\displaystyle
\hat{\theta} = s^\dagger + V_e J^{\mathrm{T}} \left( J V_e J^{\mathrm{T}} + V_\varepsilon \right)^+ \left( a - J s^\dagger \right)
where A^{+}
designates the Moore-Penrose inverse of matrix A
.
When \rho = 1
, the function returns the solution of the (modified) Denton method:
\displaystyle
\hat{\theta} = s + W \left( a - J s \right)
where
-
W
is the upper-right corner matrix from the following matrix product\left[\begin{array}{cc} D^{+} \Delta^{\mathrm{T}} \Delta D^{+} & J^{\mathrm{T}} \\ J & 0 \end{array} \right]^{+} \left[\begin{array}{cc} D^{+} \Delta^{\mathrm{T}} \Delta D^{+} & 0 \\ J & I_M \end{array} \right] = \left[\begin{array}{cc} I_T & W \\ 0 & W_\nu \end{array} \right]
-
D = \mathrm{diag} \left( \left| s \right|^\lambda \right)
, assuming0^0 = 1
. Note thatD
corresponds toC
withc_{s^\dagger} = 1.0
and without bias correction (argumentsbias_option = 1
andbias = NA
). -
\Delta
is aT-1 \times T
matrix with elements\delta_{i,j} = \left\{ \begin{array}{cl} -1 & \text{if } i=j \\ 1 & \text{if } j=i+1 \\ 0 & \text{otherwise} \end{array} \right.
. -
W_\nu
is aM \times M
matrix associated with the Lagrange multipliers of the corresponding minimization problem, expressed as:\displaystyle \begin{aligned} & \underset{\theta}{\text{minimize}} & & \sum_{t \ge 2} \left[ \frac{\left( s_t - \theta_t \right)}{\left| s_t\right|^\lambda} - \frac{\left( s_{t-1} - \theta_{t-1} \right)}{\left| s_{t-1}\right|^\lambda} \right]^2 \\ & \text{subject to} & & a = J \theta \end{aligned}
See Quenneville et al. (2006) and Dagum and Cholette (2006) for details.
Autoregressive Parameter \rho
and bias
Parameter \rho
(argument rho
) is associated to the change between the (input) indicator and the (output)
benchmarked series for two consecutive periods and is often called the movement preservation parameter. The larger
the value of \rho
, the more the indicator series period to period movements are preserved in the
benchmarked series. With \rho = 0
, period to period movement preservation is not enforced and the
resulting benchmarking adjustments are not smooth, as in the case of prorating (\rho = 0
and
\lambda = 0.5
) where the adjustments take the shape of a step function. At the other end of the
spectrum is \rho = 1
, referred to as Denton benchmarking, where period to period movement preservation
is maximized, which results in the smoothest possible set of benchmarking adjustments available with the function.
The bias represents the expected discrepancies between the benchmarks and the indicator series. It can be
used to pre-adjust the indicator series in order to reduce, on average, the discrepancies between the two
sources of data. Bias correction, which is specified with arguments biasOption
and bias
, can be particularly
useful for periods not covered by benchmarks when \rho < 1
. In this context, parameter \rho
dictates the
speed at which the projected benchmarking adjustments converge to the bias (or converge to no adjustment without bias
correction) for periods not covered by a benchmark. The smaller the value of \rho
, the faster the convergence to
the bias, with immediate convergence when \rho = 0
and no convergence at all (the adjustment of the last period
covered by a benchmark is repeated) when \rho = 1
(Denton benchmarking). Arguments biasOption
and bias
are
actually ignored when \rho = 1
since correcting for the bias has no impact on Denton benchmarking solutions.
The suggested value for \rho
is 0.9
for monthly indicators and 0.9^3 = 0.729
for quarterly indicators,
representing a reasonable compromise between maximizing movement preservation and reducing revisions as new benchmarks
become available in the future (benchmarking timeliness issue). In practice, note that Denton benchmarking could be
approximated with the regression-based model by using a \rho
value that is smaller than, but very close to,
1.0
(e.g., \rho = 0.999
). See Dagum and Cholette (2006) for a complete discussion on this topic.
Alterability Coefficients
Alterability coefficients c_{s^\dagger}
and c_a
conceptually represent the measurement errors
associated with the (bias corrected) indicator time series values s^\dagger
and benchmarks a
respectively. They are nonnegative real numbers which, in practice, specify the extent to which an initial value can be
modified in relation to other values. Alterability coefficients of 0.0
define fixed (binding) values while
alterability coefficients greater than 0.0
define free (nonbinding) values. Increasing the alterability coefficient
of an intial value results in more changes for that value in the benchmarking solution and, conversely, less changes when
decreasing the alterability coefficient. The default alterability coefficients are 0.0
for the benchmarks (binding
benchmarks) and 1.0
for the indicator series values (nonbinding indicator series). Important notes:
With a value of
\rho = 1
(argumentrho = 1
, associated to Denton Benchmarking), only the default alterability coefficients (0.0
for a benchmark and1.0
for a an indicator series value) are valid. The specification of user-defined alterability coefficients variables is therefore not allowed. If such variables are specified (see argumentsvar
andwith
), the function ignores them and displays a warning message in the console.Alterability coefficients
c_{s^\dagger}
come into play after the indicator series has been corrected for the bias, when applicable (c_{s^\dagger}
is associated tos^\dagger
, nots
). This means that specifying an alterability coefficient of0.0
for a given indicator series value will not result in an unchanged value after benchmarking with bias correction (see argumentsbiasOption
andbias
).
Nonbinding benchmarks, when applicable, can be recovered (calculated) from the benchmarked series (see output data frame
series
in section Value). The output benchmarks
data frame always contains the original benchmarks provided
in the input benchmarks data frame (argument benchmarks_df
).
Benchmarking Multiple Series
Multiple series can be benchmarked in a single benchmarking()
call, by specifying allCols = TRUE
, by
(manually) specifying multiple variables with argument var
(and argument with
) or with BY-group processing
(argument by != NULL
). An important distinction is that all indicator series specified with allCols = TRUE
or with argument var
(and benchmarks with argument with
) are expected to be of the same length, i.e., same
set of periods and same set (number) of benchmarks. Benchmarking series of different lengths (different sets of
periods) or with different sets (number) of benchmarks must be done with BY-group processing on stacked indicator
series and benchmarks input data frames (see utility functions stack_tsDF()
and stack_bmkDF()
). Arguments
by
and var
can be combined in order to implement BY-group processing for multiple series as illustrated by
Example 2 in the Examples section. While multiple variables with argument var
(or allCols = TRUE
)
without BY-group processing (argument by = NULL
) is slightly more efficient (faster), a BY-group approach with
a single series variable is usually recommended as it is more general (works in all contexts). The latter is
illustrated by Example 3 in the Examples section. The BY variables specified with argument by
appear in
all three output data frames.
Arguments constant
and negInput_option
These arguments extend the usage of proportional benchmarking to a larger set of problems. Their default
values correspond to the G-Series 2.0 behaviour (SAS^\circledR
PROC BENCHMARKING) for which equivalent
options are not defined. Although proportional benchmarking may not necessarily be the most appropriate approach
(additive benchmarking may be more appropriate) when the values of the indicator series approach 0 (unstable
period-to-period ratios) or "cross the 0 line" and can therefore go from positive to negative and vice versa
(confusing, difficult to interpret period-to-period ratios), these cases are not invalid mathematically
speaking (i.e., the associated proportional benchmarking problem can be solved). It is strongly recommended,
however, to carefully analyze and validate the resulting benchmarked data in these situations and make sure they
correspond to reasonable, interpretable solutions.
Treatment of Missing (NA
) Values
If a missing value appears in one of the variables of the benchmarks input data frame (other than the BY variables), the observations with the missing values are dropped, a warning message is displayed and the function executes.
If a missing value appears in the
year
and/orperiod
variables of the indicator series input data frame and BY variables are specified, the corresponding BY-group is skipped, a warning message is displayed and the function moves on to the next BY-group. If no BY variables are specified, a warning message is displayed and no processing is done.If a missing value appears in one of the indicator series variables in the indicator series input data frame and BY variables are specified, the corresponding BY-group is skipped, a warning message is displayed and the function moves on to the next BY-group. If no BY variables are specified, the affected indicator series is not processed, a warning message is displayed and the function moves on to the next indicator series (when applicable).
Value
The function returns is a list of three data frames:
-
series
: data frame containing the benchmarked data (primary function output). BY variables specified with argumentby
would be included in the data frame but not alterability coefficient variables specified with argumentvar
. -
benchmarks
: copy of the input benchmarks data frame (excluding invalid benchmarks when applicable). BY variables specified with argumentby
would be included in the data frame but not alterability coefficient variables specified with argumentwith
. -
graphTable
: data frame containing supplementary data useful for producing analytical tables and graphs (see functionplot_graphTable()
). It contains the following variables in addition to the BY variables specified with argumentby
:-
varSeries
: Name of the indicator series variable -
varBenchmarks
: Name of the benchmark variable -
altSeries
: Name of the user-defined indicator series alterability coefficients variable -
altSeriesValue
: Indicator series alterability coefficients -
altbenchmarks
: Name of the user-defined benchmark alterability coefficients variable -
altBenchmarksValue
: Benchmark alterability coefficients -
t
: Indicator series period identifier (1 toT
) -
m
: Benchmark coverage periods identifier (1 toM
) -
year
: Data point calendar year -
period
: Data point period (cycle) value (1 toperiodicity
) -
constant
: Temporary additive constant (argumentconstant
) -
rho
: Autoregressive parameter\rho
(argumentrho
) -
lambda
: Adjustment model parameter\lambda
(argumentlambda
) -
bias
: Bias adjustment (default, user-defined or estimated bias according to argumentsbiasOption
andbias
) -
periodicity
: The maximum number of periods in a year (e.g. 4 for a quarterly indicator series) -
date
: Character string combining the values of variablesyear
andperiod
-
subAnnual
: Indicator series values -
benchmarked
: Benchmarked series values -
avgBenchmark
: Benchmark values divided by the number of coverage periods -
avgSubAnnual
: Indicator series values (variablesubAnnual
) averaged over the benchmark coverage period -
subAnnualCorrected
: Bias corrected indicator series values -
benchmarkedSubAnnualRatio
: Difference (\lambda = 0
) or ratio (\lambda \ne 0
) of the values of variablesbenchmarked
andsubAnnual
-
avgBenchmarkSubAnnualRatio
: Difference (\lambda = 0
) or ratio (\lambda \ne 0
) of the values of variablesavgBenchmark
andavgSubAnnual
-
growthRateSubAnnual
: Period to period difference (\lambda = 0
) or relative difference (\lambda \ne 0
) of the indicator series values (variablesubAnnual
) -
growthRateBenchmarked
: Period to period difference (\lambda = 0
) or relative difference (\lambda \ne 0
) of the benchmarked series values (variablebenchmarked
)
-
Notes:
The output
benchmarks
data frame always contains the original benchmarks provided in the input benchmarks data frame. Modified nonbinding benchmarks, when applicable, can be recovered (calculated) from the outputseries
data frame.The function returns a
NULL
object if an error occurs before data processing could start. Otherwise, if execution gets far enough so that data processing could start, then an incomplete object would be returned in case of errors (e.g., outputseries
data frame withNA
values for the benchmarked data).The function returns "data.frame" objects that can be explicitly coerced to other types of objects with the appropriate
as*()
function (e.g.,tibble::as_tibble()
would coerce any of them to a tibble).
References
Dagum, E. B. and P. Cholette (2006). Benchmarking, Temporal Distribution and Reconciliation Methods of Time Series. Springer-Verlag, New York, Lecture Notes in Statistics, Vol. 186
Fortier, S. and B. Quenneville (2007). "Theory and Application of Benchmarking in Business Surveys". Proceedings of the Third International Conference on Establishment Surveys (ICES-III). Montréal, June 2007.
Latendresse, E., M. Djona and S. Fortier (2007). "Benchmarking Sub-Annual Series to Annual Totals –
From Concepts to SAS^\circledR
Procedure and Enterprise Guide^\circledR
Custom Task". Proceedings
of the SAS^\circledR
Global Forum 2007 Conference. Cary, NC: SAS Institute Inc.
Quenneville, B., S. Fortier, Z.-G. Chen and E. Latendresse (2006). "Recent Developments in Benchmarking to Annual Totals in X-12-ARIMA and at Statistics Canada". Proceedings of the Eurostat Conference on Seasonality, Seasonal Adjustment and Their Implications for Short-Term Analysis and Forecasting. Luxembourg, May 2006.
Quenneville, B., P. Cholette, S. Fortier and J. Bérubé (2010). "Benchmarking Sub-Annual Indicator Series to Annual Control Totals (Forillon v1.04.001)". Internal document. Statistics Canada, Ottawa, Canada.
Quenneville, B. and S. Fortier (2012). "Restoring Accounting Constraints in Time Series – Methods and Software for a Statistical Agency". Economic Time Series: Modeling and Seasonality. Chapman & Hall, New York.
Statistics Canada (2012). Theory and Application of Benchmarking (Course code 0436). Statistics Canada, Ottawa, Canada.
Statistics Canada (2016). "The BENCHMARKING Procedure". G-Series 2.0 User Guide. Statistics Canada, Ottawa, Canada.
See Also
stock_benchmarking()
plot_graphTable()
bench_graphs plot_benchAdj()
gs.gInv_MP()
aliases
Examples
# Set the working directory (for the PDF files)
iniwd <- getwd()
setwd(tempdir())
###########
# Example 1: Simple case with a single quarterly series to benchmark to annual values
# Quarterly indicator series
my_series1 <- ts_to_tsDF(ts(c(1.9, 2.4, 3.1, 2.2, 2.0, 2.6, 3.4, 2.4, 2.3),
start = c(2015, 1),
frequency = 4))
my_series1
# Annual benchmarks for quarterly data
my_benchmarks1 <- ts_to_bmkDF(ts(c(10.3, 10.2),
start = 2015,
frequency = 1),
ind_frequency = 4)
my_benchmarks1
# Benchmarking using...
# - recommended `rho` value for quarterly series (`rho = 0.729`)
# - proportional model (`lambda = 1`)
# - bias-corrected indicator series with the estimated bias (`biasOption = 3`)
out_bench1 <- benchmarking(my_series1,
my_benchmarks1,
rho = 0.729,
lambda = 0,
biasOption = 3)
# Generate the benchmarking graphs
plot_graphTable(out_bench1$graphTable, "Ex1_graphs.pdf")
###########
# Example 2: Two quarterly series to benchmark to annual values,
# with BY-groups and user-defined alterability coefficients
# Sales data (same sales for groups A and B; only alter coefs for van sales differ)
qtr_sales <- ts(matrix(c(# Car sales
1851, 2436, 3115, 2205, 1987, 2635, 3435, 2361, 2183, 2822,
3664, 2550, 2342, 3001, 3779, 2538, 2363, 3090, 3807, 2631,
2601, 3063, 3961, 2774, 2476, 3083, 3864, 2773, 2489, 3082,
# Van sales
1900, 2200, 3000, 2000, 1900, 2500, 3800, 2500, 2100, 3100,
3650, 2950, 3300, 4000, 3290, 2600, 2010, 3600, 3500, 2100,
2050, 3500, 4290, 2800, 2770, 3080, 3100, 2800, 3100, 2860),
ncol = 2),
start = c(2011, 1),
frequency = 4,
names = c("car_sales", "van_sales"))
ann_sales <- ts(matrix(c(# Car sales
10324, 10200, 10582, 11097, 11582, 11092,
# Van sales
12000, 10400, 11550, 11400, 14500, 16000),
ncol = 2),
start = 2011,
frequency = 1,
names = c("car_sales", "van_sales"))
# Quarterly indicator series (with default alter coefs for now)
my_series2 <- rbind(cbind(data.frame(group = rep("A", nrow(qtr_sales)),
alt_van = rep(1, nrow(qtr_sales))),
ts_to_tsDF(qtr_sales)),
cbind(data.frame(group = rep("B", nrow(qtr_sales)),
alt_van = rep(1, nrow(qtr_sales))),
ts_to_tsDF(qtr_sales)))
# Set binding van sales (alter coef = 0) for 2012 Q1 and Q2 in group A (rows 5 and 6)
my_series2$alt_van[c(5,6)] <- 0
head(my_series2, n = 10)
tail(my_series2)
# Annual benchmarks for quarterly data (without alter coefs)
my_benchmarks2 <- rbind(cbind(data.frame(group = rep("A", nrow(ann_sales))),
ts_to_bmkDF(ann_sales, ind_frequency = 4)),
cbind(data.frame(group = rep("B", nrow(ann_sales))),
ts_to_bmkDF(ann_sales, ind_frequency = 4)))
my_benchmarks2
# Benchmarking using...
# - recommended `rho` value for quarterly series (`rho = 0.729`)
# - proportional model (`lambda = 1`)
# - without bias correction (`biasOption = 1` and `bias` not specified)
# - `quiet = TRUE` to avoid generating the function header
out_bench2 <- benchmarking(my_series2,
my_benchmarks2,
rho = 0.729,
lambda = 1,
biasOption = 1,
var = c("car_sales", "van_sales / alt_van"),
with = c("car_sales", "van_sales"),
by = "group",
quiet = TRUE)
# Generate the benchmarking graphs
plot_graphTable(out_bench2$graphTable, "Ex2_graphs.pdf")
# Check the value of van sales for 2012 Q1 and Q2 in group A (fixed values)
all.equal(my_series2$van_sales[c(5,6)], out_bench2$series$van_sales[c(5,6)])
###########
# Example 3: same as example 2, but benchmarking all 4 series as BY-groups
# (4 BY-groups of 1 series instead of 2 BY-groups of 2 series)
qtr_sales2 <- ts.union(A = qtr_sales, B = qtr_sales)
my_series3 <- stack_tsDF(ts_to_tsDF(qtr_sales2))
my_series3$alter <- 1
my_series3$alter[my_series3$series == "A.van_sales"
& my_series3$year == 2012 & my_series3$period <= 2] <- 0
head(my_series3)
tail(my_series3)
ann_sales2 <- ts.union(A = ann_sales, B = ann_sales)
my_benchmarks3 <- stack_bmkDF(ts_to_bmkDF(ann_sales2, ind_frequency = 4))
head(my_benchmarks3)
tail(my_benchmarks3)
out_bench3 <- benchmarking(my_series3,
my_benchmarks3,
rho = 0.729,
lambda = 1,
biasOption = 1,
var = "value / alter",
with = "value",
by = "series",
quiet = TRUE)
# Generate the benchmarking graphs
plot_graphTable(out_bench3$graphTable, "Ex3_graphs.pdf")
# Convert data frame `out_bench3$series` to a "mts" object
qtr_sales2_bmked <- tsDF_to_ts(unstack_tsDF(out_bench3$series), frequency = 4)
# Print the first 10 observations
ts(qtr_sales2_bmked[1:10, ], start = start(qtr_sales2), deltat = deltat(qtr_sales2))
# Check the value of van sales for 2012 Q1 and Q2 in group A (fixed values)
all.equal(window(qtr_sales2[, "A.van_sales"], start = c(2012, 1), end = c(2012, 2)),
window(qtr_sales2_bmked[, "A.van_sales"], start = c(2012, 1), end = c(2012, 2)))
# Reset the working directory to its initial location
setwd(iniwd)