← 返回 Skills 市场
aipoch-ai

Adaptive Trial Simulator

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
201
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install adaptive-trial-simulator
功能描述
Design and simulate adaptive clinical trials with interim analyses, sample size re-estimation, and early stopping rules. Evaluate Type I error control, power...
使用说明 (SKILL.md)

Adaptive Trial Simulator

Statistical simulation platform for designing and validating adaptive clinical trial designs in silico. Enables optimization of interim analysis strategies, sample size adaptation, and early stopping rules while maintaining Type I error control.

Features

  • Design Simulation: Monte Carlo validation of adaptive designs
  • Sample Size Re-estimation: Adapt sample size based on interim data
  • Early Stopping Rules: Futility and efficacy boundary optimization
  • Type I Error Control: Validate alpha spending strategies
  • Multi-Arm Designs: Drop-the-loser and seamless Phase II/III
  • Power Optimization: Identify designs with maximum power efficiency

Usage

Basic Usage

# Run standard group sequential design
python scripts/main.py

# Adaptive design with sample size re-estimation
python scripts/main.py --design adaptive_reestimate

# Optimize design parameters
python scripts/main.py --optimize

Parameters

Parameter Type Default Required Description
--design str group_sequential No Trial design type
--n-simulations int 10000 No Number of Monte Carlo simulations
--sample-size int 200 No Initial sample size per arm
--effect-size float 0.3 No Effect size (Cohen's d)
--alpha float 0.05 No Type I error rate
--power float 0.80 No Target statistical power
--interim-looks int 1 No Number of interim analyses
--spending-function str obrien_fleming No Alpha spending function
--reestimate-method str promising_zone No Sample size re-estimation method
--output str results.json No Output file path
--visualize flag False No Generate visualization charts
--optimize flag False No Search for optimal design parameters

Advanced Usage

# Full adaptive design with visualization
python scripts/main.py \
  --design adaptive_reestimate \
  --n-simulations 50000 \
  --sample-size 250 \
  --effect-size 0.35 \
  --interim-looks 2 \
  --spending-function obrien_fleming \
  --visualize \
  --output adaptive_results.json

Design Types

Design Type Description Use Case
Group Sequential Fixed interim looks with stopping boundaries Standard adaptive trials
Adaptive Re-estimate Sample size adjustment based on interim data Uncertain effect size
Drop the Loser Multi-arm trials dropping inferior arms Phase II dose selection

Spending Functions

Function Characteristics Early Boundary
O'Brien-Fleming Conservative early High Z-scores early
Pocock Aggressive early Lower Z-scores throughout
Power Family Moderate (ρ=3) Balanced approach

Output Example

{
  "design_config": {
    "design_type": "adaptive_reestimate",
    "sample_size_per_arm": 200,
    "effect_size": 0.3,
    "alpha": 0.05,
    "target_power": 0.8
  },
  "simulation_results": {
    "power": 0.8234,
    "type_i_error": 0.0481,
    "expected_sample_size": 385.2,
    "early_stop_rate": {
      "efficacy": 0.1523,
      "futility": 0.0841
    }
  }
}

Technical Difficulty: HIGH

⚠️ AI自主验收状态: 需人工检查

This skill requires:

  • Python 3.8+ environment
  • NumPy, SciPy, and Matplotlib packages
  • Understanding of clinical trial statistics

Dependencies

pip install -r requirements.txt

Requirements

numpy>=1.20.0
scipy>=1.7.0
matplotlib>=3.4.0

Risk Assessment

Risk Indicator Assessment Level
Code Execution Python scripts with mathematical calculations Medium
Network Access No network access Low
File System Access Writes simulation results Low
Instruction Tampering Statistical parameters could affect results Medium
Data Exposure No sensitive data exposure Low

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access
  • Output does not expose sensitive information
  • Input parameters validated
  • Error messages sanitized
  • Dependencies audited

Prerequisites

pip install -r requirements.txt
python scripts/main.py --help

Evaluation Criteria

Success Metrics

  • Simulations run without errors
  • Type I error controlled at nominal level
  • Power estimates are accurate
  • Visualizations generated correctly

Test Cases

  1. Basic Simulation: Default parameters → Valid results
  2. Different Designs: All design types → Appropriate behavior
  3. Optimization Mode: --optimize flag → Finds optimal parameters
  4. Visualization: --visualize flag → Charts generated

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-15
  • Known Issues: Type checking warnings with numpy arrays
  • Planned Improvements:
    • Bayesian adaptive designs
    • Multi-arm multi-stage (MAMS) support
    • Enhanced visualization options

References

Available in references/:

  • Adaptive design statistical theory
  • Regulatory guidance documents
  • Alpha spending function literature
  • Sample size re-estimation methods

Limitations

  • Statistical Complexity: Requires biostatistics expertise
  • Simulation Time: Large simulations may take hours
  • Simplified Models: Does not capture all real-world complexities
  • Regulatory Consultation: Results should be validated with regulators

⚠️ DISCLAIMER: This tool provides simulation results for research and planning purposes only. All clinical trial designs should be reviewed by qualified biostatisticians and regulatory experts before implementation.

安全使用建议
This skill appears to implement what it claims (a Monte Carlo adaptive trial simulator) and does not request secrets or system privileges. Before running: (1) inspect the entire scripts/main.py (search for network modules like requests/urllib/socket, subprocess/exec/eval, os.environ access, or obfuscated strings) since the provided listing was truncated; (2) run it in a sandbox or isolated environment first (container/VM); (3) pin or audit dependencies you install (numpy/scipy/matplotlib) to avoid supply‑chain surprises; (4) avoid feeding or storing real patient/PHI data with this tool unless you perform a privacy/security review; (5) for reproducibility and safety, run with small n_simulations first and check outputs. If you want, I can scan the rest of scripts/main.py (full file) for hidden network calls or credential access.
功能分析
Type: OpenClaw Skill Name: adaptive-trial-simulator Version: 0.1.0 The adaptive-trial-simulator bundle is a legitimate statistical tool for clinical trial design simulation. The core logic in scripts/main.py uses standard scientific libraries (numpy, scipy) to perform Monte Carlo simulations, interim analyses, and sample size re-estimation without any evidence of network access, data exfiltration, or unauthorized file system interaction. The SKILL.md documentation is well-structured and contains no prompt injection attempts or instructions to perform hidden or harmful actions.
能力评估
Purpose & Capability
Name/description (adaptive clinical trial simulator) match the provided artifacts: SKILL.md documents simulation parameters and the included scripts/main.py implements sampling, alpha spending, conditional power, and sample‑size reestimation. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md tells the agent to run the included Python script with simulation flags; the instructions do not ask for reading unrelated files, environment variables, or network endpoints. The README claims 'No network access' and the visible portion of main.py contains only local numeric computations and file output. However the provided main.py content was truncated in this package listing, so the tail of the script (where unexpected behavior could appear) was not visible to me.
Install Mechanism
No install spec; it's instruction‑only plus a Python script. Dependencies are standard scientific packages (numpy, scipy, matplotlib) declared in requirements.txt — no remote/executable downloads or custom install scripts detected.
Credentials
The skill requests no environment variables, credentials, or config paths. Declared dependencies and runtime needs (Python 3.8+, NumPy/SciPy/Matplotlib) are proportionate to a statistical simulation tool.
Persistence & Privilege
The skill does not request always: true and does not modify agent/system configuration. It runs as a local script and writes simulation results (expected behaviour). No elevated persistence or cross‑skill config access is present in visible files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install adaptive-trial-simulator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /adaptive-trial-simulator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
- Initial release of the adaptive-trial-simulator skill. - Enables design and Monte Carlo simulation of adaptive clinical trials with interim analyses, sample size re-estimation, and early stopping rules. - Supports multiple adaptive design strategies, including group sequential, sample size re-estimation, and drop-the-loser multi-arm designs. - Validates Type I error control, power, and expected sample size for user-specified designs. - Command-line usage supports parameter customization, design optimization, and visualization of results. - Focused on statistical simulation; outputs results in JSON for further analysis.
元数据
Slug adaptive-trial-simulator
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Adaptive Trial Simulator 是什么?

Design and simulate adaptive clinical trials with interim analyses, sample size re-estimation, and early stopping rules. Evaluate Type I error control, power... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 201 次。

如何安装 Adaptive Trial Simulator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install adaptive-trial-simulator」即可一键安装,无需额外配置。

Adaptive Trial Simulator 是免费的吗?

是的,Adaptive Trial Simulator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Adaptive Trial Simulator 支持哪些平台?

Adaptive Trial Simulator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Adaptive Trial Simulator?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论