/** * ExperimentService - Epic 4: A/B Testing Infrastructure * * Implements: * - Experiment assignment system with balanced randomization * - Outcome tracking and data collection * - Basic statistical analysis * - Experiment lifecycle management */ import type { Database as DatabaseType } from '../db/database-interface.js'; import type { Experiment, ExperimentInput, ExperimentAssignment, ExperimentVariant, ExperimentOutcome, OutcomeInput, ExperimentAnalysis } from './types.js'; export declare class ExperimentService { private repo; constructor(db: DatabaseType); /** * Create a new experiment */ createExperiment(input: ExperimentInput): Experiment; /** * Start an experiment */ startExperiment(experimentId: string): boolean; /** * Pause an experiment */ pauseExperiment(experimentId: string): boolean; /** * Complete an experiment */ completeExperiment(experimentId: string): boolean; /** * Assign a user to an experiment (with balanced randomization) */ assignUser(experimentId: string, userId: string): ExperimentAssignment; /** * Get user's variant for an experiment */ getUserVariant(experimentId: string, userId: string): ExperimentVariant | null; /** * Record an experiment outcome */ recordOutcome(input: OutcomeInput): ExperimentOutcome; /** * Analyze experiment results */ analyzeExperiment(experimentId: string): ExperimentAnalysis; /** * Get all active experiments */ getActiveExperiments(): Experiment[]; private calculateStats; /** * Simplified t-test (for demonstration purposes) * In production, use a proper statistics library */ private tTest; /** * Normal CDF approximation (Zelen & Severo 1964) */ private normalCDF; /** * Calculate 95% confidence interval for difference in means */ private calculateConfidenceInterval; /** * Make a recommendation based on statistical analysis */ private makeRecommendation; } //# sourceMappingURL=ExperimentService.d.ts.map