Aggregation matrix of a balanced hierarchy in (possibly) unbalanced form
Source:R/fun_export.R
unbalance_hierarchy.Rd
A hierarchy with \(L\) upper levels is said to be balanced if each variable at level \(l\) has at least one child at level \(l+1\). When this doesn't hold, the hierarchy is unbalanced. This function transforms an aggregation matrix of a balanced hierarchy into an aggregation matrix of an unbalanced one, by removing possible duplicated series.
Arguments
- agg_mat
A (\(n_a \times n_b\)) numeric matrix representing the cross-sectional aggregation matrix. It maps the \(n_b\) bottom-level (free) variables into the \(n_a\) upper (constrained) variables.
- more_info
If
TRUE
, it returns only the aggregation matrix of the unbalanced hierarchy. Default isFALSE
.- sparse
Option to return sparse matrices (default is
TRUE
).
Value
A list containing four
elements (more_info = TRUE
):
- ubm
The aggregation matrix of the unbalanced hierarchy.
- agg_mat
The input matrix.
- idrm
The identification number of the duplicated variables (row numbers of the aggregation matrix
agg_mat
).- id
The identification number of each variable in the balanced hierarchy. It may contains duplicated values.
See also
Utilities:
FoReco2matrix()
,
aggts()
,
balance_hierarchy()
,
commat()
,
csprojmat()
,
cstools()
,
ctprojmat()
,
cttools()
,
df2aggmat()
,
lcmat()
,
recoinfo()
,
res2matrix()
,
shrink_estim()
,
teprojmat()
,
tetools()