Six-phase protocol for adapting methods across research domains
Provides a six-phase protocol for adapting statistical methods across research domains.
npx claudepluginhub data-wise/scholarThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Rigorous framework for adapting statistical methods across domains and settings
Use this skill when: adapting a method from one field to another, extending a method to a new setting, formalizing an intuitive connection between methods, or verifying that a transferred method retains its properties.
Taking a technique that works in Setting A and adapting it to work in Setting B, while:
Direct Application → Minor Adaptation → Major Modification → Inspired-By
│ │ │ │
Same theory Adjust for Rewrite theory New method,
applies new setting for new setting similar spirit
A successful transfer must:
This protocol provides a systematic approach to method transfer, covering all critical steps from source extraction through validation.
Goal: Extract the core mathematical and algorithmic essence of the source method
# Template for source method extraction
extract_source_method <- function(method_name, reference) {
list(
name = method_name,
estimand = "formal expression of what is estimated",
estimator = "formula for the estimator",
assumptions = c("A1: condition", "A2: condition"),
properties = c("consistency", "asymptotic normality"),
algorithm = c("Step 1: ...", "Step 2: ..."),
complexity = "O(n^2) or similar"
)
}
# Example: Extract Lasso from signal processing
lasso_extraction <- list(
name = "Lasso/Basis Pursuit",
field = "Signal Processing / Compressed Sensing",
estimand = "argmin ||y - Xb||_2^2 + lambda * ||b||_1",
key_insight = "L1 penalty induces sparsity via soft thresholding",
assumptions = c("RIP condition", "Incoherence"),
properties = c("Sparse solution", "Variable selection consistency")
)
Goal: Identify the abstract mathematical structure that enables the method
# Abstract structure identification
identify_abstraction <- function(source_method) {
list(
mathematical_structure = "e.g., M-estimation, U-statistics, kernels",
core_operation = "e.g., reweighting, regularization, projection",
information_used = "e.g., first moments, covariance, distributional",
key_invariance = "what property makes it work",
generalization_path = "how to extend beyond original setting"
)
}
# Example: Abstraction of propensity score methods
propensity_abstraction <- list(
mathematical_structure = "Reweighting to balance distributions",
core_operation = "Inverse probability weighting",
invariance = "Balances covariate distribution across groups",
generalization = "Any selection mechanism with known probabilities"
)
Goal: Deeply understand what you're transferring
## Source Method Profile
### Basic Information
- Name: [Method name]
- Source field: [Domain/area]
- Key reference: [Citation]
- What it does: [One sentence]
### Problem Solved
- Input: [What data/information goes in]
- Output: [What estimate/inference comes out]
- Setting: [When it applies]
### Mathematical Structure
- Estimand: [What it estimates, formally]
- Estimator: [How it estimates, formula]
- Loss/objective: [What it optimizes]
### Assumptions Required
1. [Assumption 1]: [Mathematical statement]
- Why needed: [Role in proof/method]
- When violated: [Failure mode]
2. [Assumption 2]: ...
### Theoretical Properties
- Consistency: [When/how proved]
- Rate: [Convergence rate]
- Asymptotic distribution: [If known]
- Efficiency: [Relative to what]
- Robustness: [To what violations]
### Computational Aspects
- Algorithm: [How implemented]
- Complexity: [Time/space]
- Software: [Available implementations]
Goal: Understand where you want to apply it
## Target Problem Profile
### Basic Information
- Problem name: [Description]
- Target field: [Domain/area]
- Motivation: [Why solve this]
### Problem Structure
- Data available: [What's observed]
- Estimand: [What you want to estimate]
- Challenges: [Why existing methods inadequate]
### Current Approaches
- Method 1: [Name, limitations]
- Method 2: [Name, limitations]
- Gap: [What's missing]
### Constraints
- Assumptions willing to make: [List]
- Assumptions NOT willing to make: [List]
- Computational constraints: [If any]
Goal: Map source concepts to their target domain counterparts
# Target mapping framework
create_target_mapping <- function(source, target) {
mapping <- list(
objects = data.frame(
source = c("treatment", "outcome", "confounder"),
target = c("mediator", "effect", "moderator"),
relationship = c("direct", "indirect", "modifies")
),
assumptions = data.frame(
source_assumption = c("SUTVA", "Ignorability"),
target_version = c("Consistency", "Sequential ignorability"),
status = c("transfers", "needs modification")
)
)
mapping
}
# Example: IV to Mendelian randomization mapping
iv_to_mr <- list(
price_instrument = "genetic_variant",
demand = "biomarker_exposure",
endogeneity = "unmeasured_confounding",
exclusion = "pleiotropic_effects",
key_difference = "biological vs economic mechanisms"
)
Goal: Identify correspondences between source and target
## Structure Map
### Object Correspondence
| Source | Target | Notes |
|--------|--------|-------|
| [Source object 1] | [Target object 1] | [How they relate] |
| [Source object 2] | [Target object 2] | [How they relate] |
| ... | ... | ... |
### Assumption Correspondence
| Source Assumption | Target Version | Status |
|-------------------|----------------|--------|
| [Source A1] | [Target A1'] | ✓ Transfers / ✗ Fails / ? Modify |
| [Source A2] | [Target A2'] | ... |
| ... | ... | ... |
### What Transfers Directly
- [Property 1]: Because [reason]
- [Property 2]: Because [reason]
### What Needs Modification
- [Element 1]: From [source version] to [target version]
- Why: [Reason for change]
- How: [Specific modification]
### What Doesn't Transfer
- [Element 1]: Because [reason]
- Impact: [What we lose]
- Alternative: [How to address]
Goal: Identify what doesn't transfer and what modifications are needed
# Gap analysis framework
analyze_transfer_gaps <- function(source, target, mapping) {
gaps <- list(
assumption_gaps = list(
violated = c("iid assumption in clustered data"),
modified = c("independence -> conditional independence"),
new_required = c("mediator positivity")
),
property_gaps = list(
lost = c("efficiency under misspecification"),
weakened = c("convergence rate n^{-1/2} -> n^{-1/4}"),
preserved = c("consistency", "asymptotic normality")
),
computational_gaps = list(
new_challenges = c("non-convex optimization"),
workarounds = c("ADMM algorithm", "approximate methods")
),
bridging_strategies = c(
"Add regularization for new setting",
"Derive modified variance estimator",
"Implement robustness check"
)
)
gaps
}
Goal: Design the transferred method
## Adapted Method Design
### Overview
[One paragraph describing the adapted method]
### Formal Definition
**Estimand**:
$$\psi = [target estimand formula]$$
**Estimator**:
$$\hat{\psi}_n = [adapted estimator formula]$$
**Algorithm**:
1. [Step 1]
2. [Step 2]
3. ...
### Modified Assumptions
1. [Assumption A1']: [New statement for target setting]
- Analogous to: [Source assumption]
- Modified because: [Reason]
### Expected Properties
- Consistency: [Conjecture/claim]
- Rate: [Expected]
- Efficiency: [Expected]
### Key Differences from Source
1. [Difference 1]: [Explanation]
2. [Difference 2]: [Explanation]
Goal: Systematically verify the transferred method works correctly
# Comprehensive validation framework for method transfer
validate_transfer <- function(adapted_method, n_sims = 1000) {
results <- list()
# 1. Bias check: Is estimator unbiased at truth?
results$bias <- run_bias_simulation(adapted_method, n_sims)
# 2. Coverage check: Do CIs achieve nominal coverage?
results$coverage <- run_coverage_simulation(adapted_method, n_sims)
# 3. Efficiency check: Compare to alternatives
results$efficiency <- compare_to_alternatives(adapted_method)
# 4. Robustness check: Behavior under violations
results$robustness <- test_assumption_violations(adapted_method)
# 5. Edge cases: Extreme scenarios
results$edge_cases <- test_edge_cases(adapted_method)
# Validation report
list(
passed = all(sapply(results, function(x) x$passed)),
details = results,
recommendations = generate_recommendations(results)
)
}
# Simulation template for validation
run_transfer_validation <- function(n = 500, n_sims = 1000) {
estimates <- replicate(n_sims, {
# Generate data under true model
data <- generate_dgp(n)
# Apply transferred method
est <- adapted_method(data)
c(estimate = est$point, se = est$se)
})
list(
bias = mean(estimates["estimate", ]) - true_value,
rmse = sqrt(mean((estimates["estimate", ] - true_value)^2)),
coverage = mean(abs(estimates["estimate", ] - true_value) <
1.96 * estimates["se", ])
)
}
Goal: Prove/demonstrate the transfer works
## Verification Plan
### Theoretical Verification
- [ ] Consistency proof
- Approach: [Proof strategy]
- Key lemma: [What needs to be shown]
- [ ] Asymptotic normality
- Approach: [Proof strategy]
- Influence function: [If applicable]
- [ ] Efficiency (if claiming)
- Approach: [Efficiency bound derivation]
### Simulation Verification
- [ ] Scenario 1: [Description]
- DGP: [Data generating process]
- Expected result: [What should happen]
- [ ] Scenario 2: Comparison to oracle
- Purpose: [Verify optimality]
- [ ] Scenario 3: Stress test
- Purpose: [Find failure modes]
### Empirical Verification
- [ ] Benchmark dataset: [If available]
- [ ] Real application: [Domain]
Goal: Document for publication
## Transfer Documentation
### Contribution Statement
"We adapt [source method] from [source field] to [target setting] by
[key modification]. Our adapted method [key property]. Unlike [alternative],
our approach [advantage]."
### Theoretical Contribution
- New result 1: [Theorem statement]
- New result 2: [If applicable]
### Methodological Contribution
- Adaptation insight: [What's novel about the transfer]
- Practical guidance: [When to use]
### What We Learned
- About source method: [New understanding]
- About target problem: [New understanding]
- General principle: [Broader insight]
Template: Estimator type from one setting to another
Example: IPW from survey sampling → causal inference
Source: Horvitz-Thompson estimator
E[Y] ≈ Σᵢ Yᵢ/πᵢ where πᵢ = P(selected)
Target: IPW for ATE
E[Y(1)] ≈ Σᵢ Yᵢ·Aᵢ/e(Xᵢ) where e(x) = P(A=1|X=x)
Mapping:
- Selection indicator → Treatment indicator
- Selection probability → Propensity score
- Survey weights → Inverse propensity weights
Key insight: Both correct for selection bias via reweighting
Template: Robustness technique from one method to another
Example: Double robustness from missing data → causal inference
Source: Augmented IPW for missing data
DR = IPW + Imputation - (IPW × Imputation)
Target: AIPW for causal effects
Same structure but for counterfactual outcomes
Mapping:
- Missing indicator → Treatment indicator
- Missingness model → Propensity model
- Imputation model → Outcome model
Key insight: Product-form bias enables robustness to one misspecification
Template: Asymptotic theory from simpler to complex setting
Example: Influence function theory → semiparametric mediation
Source: IF for smooth functional of CDF
√n(T(Fₙ) - T(F)) → N(0, E[φ²])
Target: IF for mediation effect functional
Requires: mediation-specific tangent space
Mapping:
- General functional → Mediation estimand
- CDF → Joint distribution (Y,M,A,X)
- Generic IF → Mediation-specific IF
Key insight: EIF theory applies to any pathwise differentiable functional
Template: Identification approach from one causal setting to another
Example: IV from economics → Mendelian randomization
Source: Instrumental variables for demand estimation
Z → A → Y, Z ⫫ U
Target: MR for causal effects of exposures
Gene → Biomarker → Outcome
Mapping:
- Price instrument → Genetic variant
- Demand → Exposure level
- Endogeneity → Confounding
Key insight: Exogenous variation strategy is general
Template: Algorithm from optimization → statistical estimation
Example: SGD from ML → online causal estimation
Source: Stochastic gradient descent for ERM
θₜ₊₁ = θₜ - ηₜ∇L(θₜ; Xₜ)
Target: Online updating for streaming causal data
Sequential estimation as data arrives
Mapping:
- Loss function → Estimating equation
- Gradient → Score contribution
- Learning rate → Weighting scheme
Key insight: Streaming updates possible for M-estimators
Problem: Source method relies on assumption not explicit in exposition
Example: Many ML methods implicitly assume iid data
Prevention:
Problem: Same symbol/concept means different things
Example: "Independence" in different fields
Prevention:
Problem: Method transfers but loses optimality properties
Example: MLE transferred to semiparametric setting
Prevention:
Problem: Algorithm doesn't work in new setting
Example: Newton-Raphson for optimization
Prevention:
Problem: Transfer works for one case, claimed general
Example: Method for binary → continuous
Prevention:
| Question | If No | If Yes |
|---|---|---|
| Same mathematical structure? | Major adaptation needed | Direct transfer possible |
| All assumptions translatable? | Some properties lost | Full transfer possible |
| Same data requirements? | Additional modeling needed | Straightforward application |
| Existing theory applicable? | New proofs required | Theory transfers |
| Similar computational structure? | Algorithm redesign | Code adaptation |
For each dimension, score 1-5:
| Dimension | Score | Interpretation |
|---|---|---|
| Structural similarity | __ /5 | 5 = identical structure |
| Assumption compatibility | __ /5 | 5 = all assumptions transfer |
| Theoretical portability | __ /5 | 5 = proofs carry over |
| Computational similarity | __ /5 | 5 = same algorithm works |
| Value added | __ /5 | 5 = major improvement |
Total: __/25
This skill works with:
Version: 1.0 Created: 2025-12-08 Domain: Method Development, Research Innovation
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.