def print_ar_params(phi):
    """
    Print the parameters of an AR(p) model.

    Parameters
    ----------
    phi: array_like
        Array of shape (n, p) containing the AR(p) parameters for n cascade
        levels.
    """
    print("****************************************")
    print("* AR(p) parameters for cascade levels: *")
    print("****************************************")

    n = phi.shape[1]

    hline_str = "---------"
    for _ in range(n):
        hline_str += "---------------"

    title_str = "| Level |"
    for i in range(n - 1):
        title_str += "    Phi-%d     |" % (i + 1)
    title_str += "    Phi-0     |"

    print(hline_str)
    print(title_str)
    print(hline_str)

    fmt_str = "| %-5d |"
    for _ in range(n):
        fmt_str += " %-12.6f |"

    for i in range(phi.shape[0]):
        print(fmt_str % ((i + 1,) + tuple(phi[i, :])))
        print(hline_str)
Print the parameters of an AR(p) model.

Parameters
----------
phi: array_like
Array of shape (n, p) containing the AR(p) parameters for n cascade
levels.
pysteps/nowcasts/utils.py