(problem: Dict, X: np.ndarray, Y: np.ndarray, 
            maxorder: int = 2, maxiter: int = 100, 
            m: int = 2, K: int = 20, R: int = None, alpha: float = 0.95,
            lambdax: float = 0.01,
            print_to_console: bool = True, seed: int = None)
return Si
High-Dimensional Model Representation (HDMR) using B-spline functions.

    HDMR is used for variance-based global sensitivity analysis (GSA) with 
    correlated and uncorrelated inputs. This function uses as input

    - a N x d matrix of N different d-vectors of model inputs (factors/parameters)
    - a N x 1 vector of corresponding model outputs

    Returns:
    - each factor's first, second, and third order sensitivity coefficient
      (separated in total, structural and correlative contributions), 
    - an estimate of their 95% confidence intervals (from bootstrap method)
    - the coefficients of the significant B-spline basis functions that
      govern output, 
    - Y (determined by an F-test of the error residuals of the HDMR model 
      (emulator) with/without a given first, second and/or
      third order B-spline). These coefficients define an emulator that can
      be used to predict the output, Y, of the original (CPU-intensive)
      model for any d-vector of model inputs. For uncorrelated model inputs
      (columns of X are independent), the HDMR sensitivity indices reduce
      to a single index (= structural contribution), consistent with their
      values derived from commonly used variance-based GSA methods.


    Notes
    -----
    Compatible with:
        all samplers

    Contributed by @sahin-abdullah (sahina@uci.edu)


    Parameters
    ----------
    problem : dict
        The problem definition

    X : numpy.matrix
        The NumPy matrix containing the model inputs, N rows by d columns

    Y : numpy.array
        The NumPy array containing the model outputs for each row of X

    maxorder : int (1-3, default: 2)
        Maximum HDMR expansion order

    maxiter : int (1-1000, default: 100)
        Max iterations backfitting

    m : int (2-10, default: 2)
        Number of B-spline intervals

    K : int (1-100, default: 20)
        Number of bootstrap iterations

    R : int (100-N/2, default: N/2)
        Number of bootstrap samples. Will be set to length of `Y` if `K` is set to 1.

    alpha : float (0.5-1) 
        Confidence interval F-test

    lambdax : float (0-10, default: 0.01)
        Regularization term

    print_to_console : bool
        Print results directly to console (default False)

    seed : bool
        Set a seed value


    Returns
    -------
    Si : ResultDict,
        Sa: Uncorrelated contribution
        Sa_conf: Confidence interval of Sa
        Sb: Correlated contribution
        Sb_conf: Confidence interval of Sb
        S: Total contribution of a particular term
        S_conf: Confidence interval of S
        ST: Total contribution of a particular dimension/parameter
        ST_conf: Confidence interval of ST
        Sa: Uncorrelated contribution
        select: Number of selection (F-Test)
        Em: Result set
            C1: First order coefficient
            C2: Second order coefficient
            C3: Third Order coefficient


    References
    ----------
    .. [1] Genyuan Li, H. Rabitz, P.E. Yelvington, O.O. Oluwole, F. Bacon,
            C.E. Kolb, and J. Schoendorf, "Global Sensitivity Analysis for
            Systems with Independent and/or Correlated Inputs", Journal of
            Physical Chemistry A, Vol. 114 (19), pp. 6022 - 6032, 2010,
            https://doi.org/10.1021/jp9096919


    Examples
    --------
        >>> X = saltelli.sample(problem, 512)
        >>> Y = Ishigami.evaluate(X)
        >>> Si = hdmr.analyze(problem, X, Y, **options)
High-Dimensional Model Representation (HDMR) using B-spline functions.
High - Dimensional Model Representation ( HDMR ) using B - spline functions .
def analyze(problem: Dict, X: np.ndarray, Y: np.ndarray, 
            maxorder: int = 2, maxiter: int = 100, 
            m: int = 2, K: int = 20, R: int = None, alpha: float = 0.95,
            lambdax: float = 0.01,
            print_to_console: bool = True, seed: int = None) -> Dict:
    """High-Dimensional Model Representation (HDMR) using B-spline functions.

    HDMR is used for variance-based global sensitivity analysis (GSA) with 
    correlated and uncorrelated inputs. This function uses as input

    - a N x d matrix of N different d-vectors of model inputs (factors/parameters)
    - a N x 1 vector of corresponding model outputs

    Returns:
    - each factor's first, second, and third order sensitivity coefficient
      (separated in total, structural and correlative contributions), 
    - an estimate of their 95% confidence intervals (from bootstrap method)
    - the coefficients of the significant B-spline basis functions that
      govern output, 
    - Y (determined by an F-test of the error residuals of the HDMR model 
      (emulator) with/without a given first, second and/or
      third order B-spline). These coefficients define an emulator that can
      be used to predict the output, Y, of the original (CPU-intensive)
      model for any d-vector of model inputs. For uncorrelated model inputs
      (columns of X are independent), the HDMR sensitivity indices reduce
      to a single index (= structural contribution), consistent with their
      values derived from commonly used variance-based GSA methods.


    Notes
    -----
    Compatible with:
        all samplers

    Contributed by @sahin-abdullah (sahina@uci.edu)


    Parameters
    ----------
    problem : dict
        The problem definition

    X : numpy.matrix
        The NumPy matrix containing the model inputs, N rows by d columns

    Y : numpy.array
        The NumPy array containing the model outputs for each row of X

    maxorder : int (1-3, default: 2)
        Maximum HDMR expansion order

    maxiter : int (1-1000, default: 100)
        Max iterations backfitting

    m : int (2-10, default: 2)
        Number of B-spline intervals

    K : int (1-100, default: 20)
        Number of bootstrap iterations

    R : int (100-N/2, default: N/2)
        Number of bootstrap samples. Will be set to length of `Y` if `K` is set to 1.

    alpha : float (0.5-1) 
        Confidence interval F-test

    lambdax : float (0-10, default: 0.01)
        Regularization term

    print_to_console : bool
        Print results directly to console (default False)

    seed : bool
        Set a seed value


    Returns
    -------
    Si : ResultDict,
        Sa: Uncorrelated contribution
        Sa_conf: Confidence interval of Sa
        Sb: Correlated contribution
        Sb_conf: Confidence interval of Sb
        S: Total contribution of a particular term
        S_conf: Confidence interval of S
        ST: Total contribution of a particular dimension/parameter
        ST_conf: Confidence interval of ST
        Sa: Uncorrelated contribution
        select: Number of selection (F-Test)
        Em: Result set
            C1: First order coefficient
            C2: Second order coefficient
            C3: Third Order coefficient


    References
    ----------
    .. [1] Genyuan Li, H. Rabitz, P.E. Yelvington, O.O. Oluwole, F. Bacon,
            C.E. Kolb, and J. Schoendorf, "Global Sensitivity Analysis for
            Systems with Independent and/or Correlated Inputs", Journal of
            Physical Chemistry A, Vol. 114 (19), pp. 6022 - 6032, 2010,
            https://doi.org/10.1021/jp9096919


    Examples
    --------
        >>> X = saltelli.sample(problem, 512)
        >>> Y = Ishigami.evaluate(X)
        >>> Si = hdmr.analyze(problem, X, Y, **options)
    """
    # Random Seed
    if seed:
        np.random.seed(seed)

    # Initial part: Check input arguments and define HDMR variables
    settings = _check_settings(X, Y, maxorder, maxiter, m, K, R, alpha, lambdax)
    init_vars = _init(X, Y, settings)

    # Sensitivity Analysis Computation with/without bootstraping
    SA, Em, RT, Y_em, idx = _compute(X, Y, settings, init_vars)

    # Finalize results
    Si = _finalize(problem, SA, Em, problem['num_vars'], alpha, maxorder, RT, Y_em, idx, X, Y)

    # Print results to console
    if print_to_console:
        _print(Si, problem['num_vars'])

    return Si
def analyze ( problem : Dict , X : np . ndarray , Y : np . ndarray , maxorder : int = 2 , maxiter : int = 100 , m : int = 2 , K : int = 20 , R : int = None , alpha : float = 0.95 , lambdax : float = 0.01 , print_to_console : bool = True , seed : int = None ) -> Dict : # Random Seed if seed : np . random . seed ( seed ) # Initial part: Check input arguments and define HDMR variables settings = _check_settings ( X , Y , maxorder , maxiter , m , K , R , alpha , lambdax ) init_vars = _init ( X , Y , settings ) # Sensitivity Analysis Computation with/without bootstraping SA , Em , RT , Y_em , idx = _compute ( X , Y , settings , init_vars ) # Finalize results Si = _finalize ( problem , SA , Em , problem [ 'num_vars' ] , alpha , maxorder , RT , Y_em , idx , X , Y ) # Print results to console if print_to_console : _print ( Si , problem [ 'num_vars' ] ) return Si