class_docstr: Statistical Power calculations for generic F-test of a constraint
  
  This class is not recommended, use `FTestPowerF2` with corrected interface.
  
  This is based on Cohen's f as effect size measure.
  
  Warning: Methods in this class have the names df_num and df_denom reversed.
  
  See Also
  --------
  FTestPowerF2 :
      Class with Cohen's f-squared as effect size, corrected keyword names.
  
  Examples
  --------
  Sample size and power for multiple regression base on R-squared
  
  Compute effect size from R-squared
  
  >>> r2 = 0.1
  >>> f2 = r2 / (1 - r2)
  >>> f = np.sqrt(f2)
  >>> r2, f2, f
  (0.1, 0.11111111111111112, 0.33333333333333337)
  
  Find sample size by solving for denominator df, wrongly named ``df_num``
  
  >>> df1 = 1  # number of constraints in hypothesis test
  >>> df2 = FTestPower().solve_power(effect_size=f, alpha=0.1, power=0.9,
                                     df_denom=df1)
  >>> ncc = 1  # default
  >>> nobs = df2 + df1 + ncc
  >>> df2, nobs
  (76.46459758305376, 78.46459758305376)
  
  verify power at df2
  
  >>> FTestPower().power(effect_size=f, alpha=0.1, df_denom=df1, df_num=df2)
  0.8999999972109698
class_docstr_tok: ["Statistical","Power","calculations","for","generic","F-test","of","a","constraint","This","class","is","not","recommended",",","use","`","FTestPowerF2","`","with","corrected","interface",".","This","is","based","on","Cohen","'s","f","as","effect","size","measure",".","Warning",":","Methods","in","this","class","have","the","names","df_num","and","df_denom","reversed",".","See","Also","--","--","--","--","FTestPowerF2",":","Class","with","Cohen","'s","f-squared","as","effect","size",",","corrected","keyword","names",".","Examples","--","--","--","--","Sample","size","and","power","for","multiple","regression","base","on","R-squared","Compute","effect","size","from","R-squared",">",">",">","r2","=","0.1",">",">",">","f2","=","r2","\/","(","1","-","r2",")",">",">",">","f","=","np.sqrt","(","f2",")",">",">",">","r2",",","f2",",","f","(","0.1",",","0.11111111111111112",",","0.33333333333333337",")","Find","sample","size","by","solving","for","denominator","df",",","wrongly","named","``","df_num","``",">",">",">","df1","=","1","#","number","of","constraints","in","hypothesis","test",">",">",">","df2","=","FTestPower","(",")",".solve_power","(","effect_size=f",",","alpha=0.1",",","power=0.9",",","df_denom=df1",")",">",">",">","ncc","=","1","#","default",">",">",">","nobs","=","df2","+","df1","+","ncc",">",">",">","df2",",","nobs","(","76.46459758305376",",","78.46459758305376",")","verify","power","at","df2",">",">",">","FTestPower","(",")",".power","(","effect_size=f",",","alpha=0.1",",","df_denom=df1",",","df_num=df2",")","0.8999999972109698"]
docstr: Calculate the power of a F-test.
  
  The effect size is Cohen's ``f``, square root of ``f2``.
  
  The sample size is given by ``nobs = df_denom + df_num + ncc``
  
  Warning: The meaning of df_num and df_denom is reversed.
  
  Parameters
  ----------
  effect_size : float
      Standardized effect size. The effect size is here Cohen's ``f``,
      square root of ``f2``.
  df_num : int or float
      Warning incorrect name
      denominator degrees of freedom,
      This corresponds to the number of constraints in Wald tests.
  df_denom : int or float
      Warning incorrect name
      numerator degrees of freedom.
      This corresponds to the df_resid in Wald tests.
  alpha : float in interval (0,1)
      significance level, e.g. 0.05, is the probability of a type I
      error, that is wrong rejections if the Null Hypothesis is true.
  ncc : int
      degrees of freedom correction for non-centrality parameter.
      see Notes
  
  Returns
  -------
  power : float
      Power of the test, e.g. 0.8, is one minus the probability of a
      type II error. Power is the probability that the test correctly
      rejects the Null Hypothesis if the Alternative Hypothesis is true.
  
  Notes
  -----
  
  sample size is given implicitly by df_num
  
  set ncc=0 to match t-test, or f-test in LikelihoodModelResults.
  ncc=1 matches the non-centrality parameter in R::pwr::pwr.f2.test
  
  ftest_power with ncc=0 should also be correct for f_test in regression
  models, with df_num and d_denom as defined there. (not verified yet)
docstr_tok: ["Calculate","the","power","of","a","F-test",".","The","effect","size","is","Cohen","'s","``","f","``",",","square","root","of","``","f2","``",".","The","sample","size","is","given","by","``","nobs","=","df_denom","+","df_num","+","ncc","``","Warning",":","The","meaning","of","df_num","and","df_denom","is","reversed",".","Parameters","--","--","--","--","--","effect_size",":","float","Standardized","effect","size",".","The","effect","size","is","here","Cohen","'s","``","f","``",",","square","root","of","``","f2","``",".","df_num",":","int","or","float","Warning","incorrect","name","denominator","degrees","of","freedom",",","This","corresponds","to","the","number","of","constraints","in","Wald","tests",".","df_denom",":","int","or","float","Warning","incorrect","name","numerator","degrees","of","freedom",".","This","corresponds","to","the","df_resid","in","Wald","tests",".","alpha",":","float","in","interval","(","0,1",")","significance","level",",","e.g",".","0.05",",","is","the","probability","of","a","type","I","error",",","that","is","wrong","rejections","if","the","Null","Hypothesis","is","true",".","ncc",":","int","degrees","of","freedom","correction","for","non-centrality","parameter",".","see","Notes","Returns","--","--","--","-","power",":","float","Power","of","the","test",",","e.g",".","0.8",",","is","one","minus","the","probability","of","a","type","II","error",".","Power","is","the","probability","that","the","test","correctly","rejects","the","Null","Hypothesis","if","the","Alternative","Hypothesis","is","true",".","Notes","--","--","-","sample","size","is","given","implicitly","by","df_num","set","ncc=0","to","match","t-test",",","or","f-test","in","LikelihoodModelResults",".","ncc=1","matches","the","non-centrality","parameter","in","R",":",":pwr",":",":pwr.f2.test","ftest_power","with","ncc=0","should","also","be","correct","for","f_test","in","regression","models",",","with","df_num","and","d_denom","as","defined","there",".","(","not","verified","yet",")"]
code: def power(self, effect_size, df_num, df_denom, alpha, ncc=1):
      """Calculate the power of a F-test.
  
      The effect size is Cohen's ``f``, square root of ``f2``.
  
      The sample size is given by ``nobs = df_denom + df_num + ncc``
  
      Warning: The meaning of df_num and df_denom is reversed.
  
      Parameters
      ----------
      effect_size : float
          Standardized effect size. The effect size is here Cohen's ``f``,
          square root of ``f2``.
      df_num : int or float
          Warning incorrect name
          denominator degrees of freedom,
          This corresponds to the number of constraints in Wald tests.
      df_denom : int or float
          Warning incorrect name
          numerator degrees of freedom.
          This corresponds to the df_resid in Wald tests.
      alpha : float in interval (0,1)
          significance level, e.g. 0.05, is the probability of a type I
          error, that is wrong rejections if the Null Hypothesis is true.
      ncc : int
          degrees of freedom correction for non-centrality parameter.
          see Notes
  
      Returns
      -------
      power : float
          Power of the test, e.g. 0.8, is one minus the probability of a
          type II error. Power is the probability that the test correctly
          rejects the Null Hypothesis if the Alternative Hypothesis is true.
  
      Notes
      -----
  
      sample size is given implicitly by df_num
  
      set ncc=0 to match t-test, or f-test in LikelihoodModelResults.
      ncc=1 matches the non-centrality parameter in R::pwr::pwr.f2.test
  
      ftest_power with ncc=0 should also be correct for f_test in regression
      models, with df_num and d_denom as defined there. (not verified yet)
      """
  
      pow_ = ftest_power(effect_size, df_num, df_denom, alpha, ncc=ncc)
      # print effect_size, df_num, df_denom, alpha, pow_
      return pow_
  
imports: import warnings
  import numpy
  from scipy import stats, optimize, special
  from statsmodels.tools.rootfinding import brentq_expanding
label_desc: Use image node_id 1 for calling the FTestPower obj's underlying member method code with example usage: obj.power(effect_size, df_num, df_denom, alpha, ncc) and returns: pow_