code: def _f_test(Y_idx, Y_e, alpha, hdmr):
      """Finds component functions that make significant contribution to the
      model output. This statistical analysis is done by F-test which uses
      F-distribution.
  
      Parameters
      ----------
      Y_idx : numpy.array
          Model output for a single bootstrap iteration
      Y_e : numpy.array
          Emulated output
      alpha : float
          Significance level
      hdmr : namedtuple
          Core parameters of hdmr expansion
  
      Returns
      -------
      result : numpy.array
          Binary array that shows significant components
      """
      # Initialize result array
      result = np.zeros(hdmr.nc_t)
      # Sum of squared residuals of smaller model
      SSR0 = (Y_idx**2).sum()
      # Now adding each term to the model
      for i in range(hdmr.nc_t):
          # Model with ith term excluded
          Y_res = Y_idx - Y_e[:, i]
          # Number of parameters of proposed model (order dependent)
          if i < hdmr.nc1:
              p1 = hdmr.nt1  # 1st order
          elif hdmr.nc1 <= i < (hdmr.nc1 + hdmr.nc2):
              p1 = hdmr.nt2  # 2nd order
          else:
              p1 = hdmr.nt3  # 3rd order
          # Sum of squared residuals of bigger model
          SSR1 = (Y_res**2).sum()
          # Now calculate the F_stat (F_stat > 0 -> SSR1 < SSR0 )
          F_stat = ((SSR0 - SSR1) / p1) / (SSR1 / (hdmr.subset - p1))
          # Now calculate critical F value
          F_crit = stats.f.ppf(q=alpha, dfn=p1, dfd=hdmr.subset - p1)
          # Now determine whether to accept ith component into model
          if F_stat > F_crit:
              # ith term is significant and should be included in model
              result[i] = 1
  
      return result
  
imports: import math
  import warnings
  from typing import Dict, Tuple
  from types import MethodType
  from itertools import combinations, product
  from collections import defaultdict, namedtuple
  import numpy
  from pandas import DataFrame
  from numpy.linalg import det, pinv, matrix_rank
  from scipy.linalg import svd, LinAlgError, solve
  from scipy import stats, special
  from .None import common_args
  from ..util import read_param_file, ResultDict
label_desc: Use image node_id 15 for calling a global function with example usage: _f_test(Y_idx, Y_e, alpha, hdmr) and returns: result