ENH/Design: pattern for simulate_power functions

Open
#6,716 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by reviewing PR #6526 and the existing ANOVA and equivalence-ANOVA power calculations. Define the shared simulation inputs and how null and alternative values are represented, including test options such as value and method. Done requires a settled API and simulated-power functions that cover cases such as trimmed ANOVA and trim_frac.

Written by the indexing model from the issue text.

Description

comp-stats type-enh

For PR #6526 I spent some time simulating power for anova and equivalence-anova to verify the theoretical power computation. This could be dressed up in functions for the users so they can simulate the power for different cases, e.g. trimmed anova, option trim_frac, is not yet supported by the power calculation.

For simple cases a simulate_xxx_power function wouldn't require a complicated setup. We need

  • options for the hypothesis test including value if nonzero and method options
  • part of dgp that is common to null and alternative, distribution of data, variances, ...
  • values that differ between alternative and null, either as given values for alternative or specified as diff to the null.
  • parts that are invariant for power computation can be unspecified and hard coded , e.g. actual value of common mean in anova under the null is irrelevant for power and can be set to zero.

I never looked closely at what packages in R are doing.

Dominant language
Python
Stars
11.6k
Forks
3.6k
Avg merge
7h 37m
Merged PRs (30d)
96

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from statsmodels/statsmodels

All issues in statsmodels/statsmodels

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.