trial-optimizer-graphical

Optimize multiplicity control designs with a standalone, vendored trial_optimizer implementation (graphical procedures: alpha weights + transition matrix; optional group sequential/interim analyses with alpha spending). Use this skill whenever the user mentions trial_optimizer, graphical procedures, multiplicity/FWER, alpha allocation, transition matrices, or group sequential / interim analyses (O'Brien-Fleming, Pocock, Hwang-Shih-DeCani) and wants an optimized procedure or a reproducible optimization run.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "trial-optimizer-graphical" with this command: npx skills add jujae/trial-optimizer/jujae-trial-optimizer-trial-optimizer-graphical

Trial Optimizer (Graphical + Sequential) Skill

Use this skill to turn a trial's multiplicity problem statement into a reproducible optimization run using the standalone trial-optimizer-graphical skill (it vendors the trial_optimizer Python package, so no separate repo checkout is required).

What this skill produces

You will:

  • Create a JSON config capturing the trial assumptions (effect sizes, correlation), objective (endpoint priorities / gating), and optimization parameters.
  • Run a bundled runner script to produce:
    • result.json (optimal weights/transitions + Monte Carlo power metrics)
    • Optional plots (when dependencies are available):
      • design_optimized.png (graph visualization; needs networkx)
      • training.png (loss/objective history)

Inputs you must confirm with the user

Collect (or infer from context) the following:

  • m: number of hypotheses/endpoints
  • alpha: one-sided familywise error rate (often 0.025)
  • effect_sizes: expected Z-scale effects (length m)
  • correlation: either a scalar equicorrelation (e.g. 0.3) or a full m x m correlation matrix
  • Objective:
    • weights: relative importance per endpoint (length m)
    • optional gating dependencies: hierarchical rules like "H2 only counts if H1 succeeds"
  • Whether this is single-stage (default) or group sequential:
    • n_analyses, information_fractions
    • spending function choice (OBF / Pocock / Linear / HSD(gamma)) and whether to optimize HSD gamma

If the user is unsure, default to:

  • objective = weighted marginal rejection with equal weights
  • single-stage (non-sequential)

Workflow

1) Install Python dependencies

This skill vendors the trial_optimizer code, but you still need its Python dependencies installed in whatever environment you run the script.

Minimal install (PowerShell):

python -m pip install --upgrade pip
python -m pip install torch numpy scipy matplotlib tqdm

Optional (only for the graph PNG):

python -m pip install networkx

2) Create a config JSON

Start from one of the examples in references/:

  • references\config_example_graphical.json
  • references\config_example_sequential.json
  • references\config_example_gated.json

Copy one next to where you want outputs, then edit it.

3) Run the optimization

From anywhere (using an explicit interpreter):

$py = "<path-to-python-interpreter>"  # e.g. .\.venv\Scripts\python.exe on Windows
& $py <path-to-skill-dir>\scripts\run_trial_optimizer.py `
  --config .\trial_optimizer_config.json `
  --outdir .\trial_optimizer_out

4) Report results back to the user

Always include:

  • Optimal weights (sum to 1)
  • Transition matrix (rows should sum to <= 1)
  • Benchmark power metrics (marginal, disjunctive, conjunctive, expected rejections)
  • The output directory with artifacts

Notes / gotchas

  • The upstream project has migrated to the new objective API (WeightedSuccess, MarginalRejection, GatedSuccess). Avoid legacy objective class names.
  • Optimization is stochastic; for "final" numbers, increase benchmark.n_simulations and consider increasing optimizer.n_eval_samples.
  • For sequential designs, confirm information fractions are sensible and monotone increasing to 1.0.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

site-ranking

No summary provided by upstream source.

Repository SourceNeeds Review
General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated
General

explainer

Create explainer videos with narration and AI-generated visuals. Triggers on: "解说视频", "explainer video", "explain this as a video", "tutorial video", "introduce X (video)", "解释一下XX(视频形式)".

Archived SourceRecently Updated
General

asr

Transcribe audio files to text using local speech recognition. Triggers on: "转录", "transcribe", "语音转文字", "ASR", "识别音频", "把这段音频转成文字".

Archived SourceRecently Updated