def METHOD_NAME():
    # Simple three-level hierarchy containing 4 leaf nodes.
    S = np.vstack(([[1, 1, 1, 1], [1, 1, 0, 0], [0, 0, 1, 1]], np.eye(4)))
    num_ts, num_bottom_ts = S.shape
    ts_at_bottom_level = random_ts(
        num_ts=num_bottom_ts,
        periods=PERIODS,
        freq=FREQ,
    )
    hts = HierarchicalTimeSeries(ts_at_bottom_level=ts_at_bottom_level, S=S)
    ts_at_all_levels = hts.ts_at_all_levels
    assert (ts_at_all_levels.index == ts_at_bottom_level.index).all(), (
        "The index of dataframe `ts_at_all_levels` does not match "
        "with that of  `ts_at_bottom_level`:\n"
        f"Index of `ts_at_bottom_level`: {ts_at_bottom_level.index}, \n "
        f"Index of `ts_at_all_levels`: {ts_at_all_levels.index}."
    )
    assert ts_at_all_levels.shape == (PERIODS, num_ts), (
        "Hierarchical time series do not have the right shape. "
        f"Expected: {(PERIODS, num_ts)}, "
        f"Obtained: {ts_at_bottom_level.shape}!"
    )
    root_level = hts.ts_at_all_levels.iloc[:, 0]
    root_level_expected = ts_at_bottom_level.sum(axis=1)
    np.testing.assert_array_almost_equal(
        root_level.values,
        root_level_expected.values,
        err_msg="Values of the time series at the root"
        "level are not correctly computed.",
    )
    level_1 = hts.ts_at_all_levels.iloc[:, 1:3]
    level_1_expected = pd.concat(
        [
            ts_at_bottom_level.iloc[:, :2].sum(axis=1),
            ts_at_bottom_level.iloc[:, 2:].sum(axis=1),
        ],
        axis=1,
    )
    np.testing.assert_array_almost_equal(
        level_1.values,
        level_1_expected.values,
        err_msg="Values of the time series at the first"
        "aggregated level (after the root) are not "
        "correctly computed.",
    )
    leaf_level = hts.ts_at_all_levels.iloc[:, 3:]
    np.testing.assert_array_almost_equal(
        ts_at_bottom_level.values,
        leaf_level.values,
        err_msg="Values of the time series at the bottom "
        "level do not agree with the given inputs.",
    )