power¶
- hyppo.tools.power(test, sim_type, sim=None, n=100, alpha=0.05, reps=1000, auto=False, **kwargs)¶
Computes empircal power for hypothesis tests
- Parameters
test (
str
orlist
) -- The name of the independence test (from thehyppo.independence
module, thehyppo.d_variate
module, or thehyppo.conditional
module) that is to be tested. If MaxMargin, accepts list with first entry "MaxMargin" and second entry the name of another independence test. Forhyppo.ksample.KSample
put the name of the independence test. For other tests inhyppo.ksample
just use the name of the class.sim_type (
"indep"
,"ksamp"
,"gauss"
,"multi"
,"condi"
) -- Type of power method to calculate. Depends on the type ofsim
.sim (
str
, default:None
) -- The name of the independence simulation (from thehyppo.tools
module). that is to be used. Set toNone
if using Gaussian simulation curve.n (
int
, default:100
) -- The number of samples desired by the simulation (>= 5).alpha (
float
, default:0.05
) -- The alpha level of the test.reps (
int
, default:1000
) -- The number of replications used to estimate the null distribution when using the permutation test used to calculate the p-value.auto (
bool
, default:False
) -- Automatically uses fast approximation when n and size of array is greater than 20 or test has a non-permutation based p-value. IfTrue
, and sample size is greater than 20, thenhyppo.tools.chi2_approx
will be run.reps
is irrelevant in this case. See documentation fortest
if this parameter applies.**kwargs -- Additional keyword arguements for
sim
.
- Returns
empirical_power (
ndarray
offloat
) -- Estimated empirical power for the test.