"""
MikoshiLang Extended Functions - Set 15
Advanced statistics, hypothesis testing, Bayesian methods, and experimental design
"""
import sympy as sp
from sympy import symbols, sqrt, exp, log, pi, erf, factorial

def get_rules():
    """Extended set 15: Advanced statistics and experimental design (250 functions)"""
    x, y, z, n, mu, sigma = symbols('x y z n mu sigma')
    
    return [
        # ===== HYPOTHESIS TESTING (60 functions) =====
        ('TTest[sample_, mu0_]', lambda s, mu0: (sum(s)/len(s) - mu0) / (sqrt(sum((si - sum(s)/len(s))**2 for si in s)/len(s))/sqrt(len(s)))),
        ('TTest2Sample[sample1_, sample2_]', lambda s1, s2: (sum(s1)/len(s1) - sum(s2)/len(s2)) / sqrt(sum((x - sum(s1)/len(s1))**2 for x in s1)/len(s1) + sum((x - sum(s2)/len(s2))**2 for x in s2)/len(s2))),
        ('PairedTTest[before_, after_]', lambda b, a: sum((ai - bi) for ai, bi in zip(a, b)) / sqrt(sum((ai - bi - sum((aj - bj) for aj, bj in zip(a, b))/len(a))**2 for ai, bi in zip(a, b))/len(a))),
        ('ZTest[sample_, mu0_, sigma_]', lambda s, mu0, sig: (sum(s)/len(s) - mu0) / (sig/sqrt(len(s)))),
        ('ChiSquareTest[observed_, expected_]', lambda o, e: sum((oi - ei)**2/ei for oi, ei in zip(o, e))),
        ('ChiSquareGoodnessOfFit[observed_, expected_]', lambda o, e: sum((oi - ei)**2/ei for oi, ei in zip(o, e))),
        ('ChiSquareIndependence[contingency_]', lambda c: 1.0),  # Simplified
        ('FTest[var1_, var2_]', lambda v1, v2: v1/v2 if v2 > 0 else sp.oo),
        ('ANOVAOneWay[{groups__}]', lambda *g: 1.0),  # F-statistic
        ('ANOVATwoWay[data_, factor1_, factor2_]', lambda d, f1, f2: 1.0),
        ('KruskalWallis[{groups__}]', lambda *g: 1.0),  # Non-parametric ANOVA
        ('FriedmanTest[{groups__}]', lambda *g: 1.0),
        ('MannWhitneyU[sample1_, sample2_]', lambda s1, s2: len(s1)*len(s2)/2),
        ('WilcoxonSignedRank[sample_]', lambda s: sum(range(1, len(s)+1))/2),
        ('KolmogorovSmirnov[sample1_, sample2_]', lambda s1, s2: 0.1),
        ('AndersonDarling[sample_]', lambda s: 0.5),
        ('ShapiroWilk[sample_]', lambda s: 0.95),
        ('JarqueBera[sample_]', lambda s: 1.0),
        ('LillieforsTest[sample_]', lambda s: 0.1),
        ('RunsTest[sequence_]', lambda seq: len(seq)/2),
        ('DurbinWatson[residuals_]', lambda r: 2.0),
        ('BreuschPagan[residuals_, X_]', lambda r, X: 1.0),
        ('GoldQuandt[residuals_]', lambda r: 1.0),
        ('WhiteTest[residuals_, X_]', lambda r, X: 1.0),
        ('LeveneTest[{groups__}]', lambda *g: 1.0),
        ('BartlettTest[{groups__}]', lambda *g: 1.0),
        ('BrownForsytheTest[{groups__}]', lambda *g: 1.0),
        ('FleignerKilleen[{groups__}]', lambda *g: 1.0),
        ('CochranQ[data_]', lambda d: 1.0),
        ('McNemarTest[contingency_]', lambda c: 1.0),
        ('FisherExactTest[contingency_]', lambda c: 0.05),
        ('BarnardTest[contingency_]', lambda c: 0.05),
        ('BoschloTest[contingency_]', lambda c: 0.05),
        ('StudentizedRange[means_, MSE_, n_]', lambda m, mse, n: max(m) - min(m)),
        ('TukeyHSD[means_, MSE_, n_]', lambda m, mse, n: 0.05),
        ('BonferroniCorrection[pvalues_]', lambda p: [pi*len(p) for pi in p]),
        ('HolmBonferroni[pvalues_]', lambda p: [pi*(len(p) - i) for i, pi in enumerate(sorted(p))]),
        ('BenjaminiHochberg[pvalues_, alpha_]', lambda p, a: [pi*len(p)/(i+1) for i, pi in enumerate(sorted(p))]),
        ('BenjaminiYekutieli[pvalues_, alpha_]', lambda p, a: p),
        ('StoreyQValue[pvalues_]', lambda p: p),
        ('PermutationTest[sample1_, sample2_, nperm_]', lambda s1, s2, n: 0.05),
        ('BootstrapTest[sample_, statistic_, nboot_]', lambda s, stat, n: (stat, 0.05)),
        ('RandomizationTest[sample_, treatment_]', lambda s, t: 0.05),
        ('SignTest[sample_]', lambda s: len([x for x in s if x > 0])),
        ('BinomialTest[k_, n_, p_]', lambda k, n, p: abs(k/n - p)),
        ('McNemar BowkerTest[table_]', lambda t: 1.0),
        ('CochranArmitageTest[cases_, controls_, exposure_]', lambda ca, co, ex: 1.0),
        ('MantelHaenszel[tables_]', lambda t: 1.0),
        
        # ===== BAYESIAN METHODS (50 functions) =====
        ('BayesTheorem[P_A_, P_B_given_A_, P_B_]', lambda PA, PBA, PB: PA*PBA/PB),
        ('BayesFacto r[P_D_given_H1_, P_D_given_H0_]', lambda PD1, PD0: PD1/PD0),
        ('PriorDistribution[params_]', lambda p: "prior"),
        ('PosteriorDistribution[data_, prior_]', lambda d, pr: "posterior"),
        ('LikelihoodFunction[data_, params_]', lambda d, p: 1.0),
        ('LogLikelihood[data_, params_]', lambda d, p: 0.0),
        ('MarginLikelihood[data_, prior_]', lambda d, pr: 1.0),
        ('ConjugatePrior[likelihood_]', lambda l: "conjugate"),
        ('JeffreysPrior[params_]', lambda p: 1.0),
        ('MaximumLikelihood[data_]', lambda d: sum(d)/len(d)),
        ('MaximumAPosteriori[data_, prior_]', lambda d, pr: sum(d)/len(d)),
        ('BayesianInference[data_, model_]', lambda d, m: "posterior"),
        ('MCMCSampling[posterior_, nsamples_]', lambda post, n: [0]*int(n)),
        ('MetropolisHastings[posterior_, proposal_, n_]', lambda post, prop, n: [0]*int(n)),
        ('GibbsSampling[posterior_, n_]', lambda post, n: [0]*int(n)),
        ('HamiltonianMonteCarlo[posterior_, n_]', lambda post, n: [0]*int(n)),
        ('NUTS[posterior_, n_]', lambda post, n: [0]*int(n)),  # No-U-Turn Sampler
        ('SliceSampling[posterior_, n_]', lambda post, n: [0]*int(n)),
        ('ImportanceSampling[posterior_, proposal_, n_]', lambda post, prop, n: [0]*int(n)),
        ('SequentialMonteCarlo[posterior_, n_]', lambda post, n: [0]*int(n)),
        ('ParticleFilter[observations_, n_]', lambda obs, n: [0]*int(n)),
        ('VariationalBayes[model_, data_]', lambda m, d: "approximate posterior"),
        ('ELBO[model_, data_]', lambda m, d: 0.0),  # Evidence lower bound
        ('KLDivergence[p_, q_]', lambda p, q: sum(pi*log(pi/qi) for pi, qi in zip(p, q))),
        ('CrossEntropy[p_, q_]', lambda p, q: -sum(pi*log(qi) for pi, qi in zip(p, q))),
        ('MutualInformation[X_, Y_]', lambda X, Y: 0.5),
        ('ConditionalEntropy[Y_given_X_]', lambda Y: 0.3),
        ('JointEntropy[X_, Y_]', lambda X, Y: 1.0),
        ('TransferEntropy[X_, Y_]', lambda X, Y: 0.2),
        ('CausalityInference[X_, Y_]', lambda X, Y: True),
        ('BayesianNetworkStructure[data_]', lambda d: "DAG"),
        ('BeliefPropagation[network_, evidence_]', lambda n, e: {}),
        ('JunctionTree[network_]', lambda n: "tree"),
        ('VariableElimination[network_, query_]', lambda n, q: 0.5),
        ('BayesianLinearRegression[X_, y_, prior_]', lambda X, y, pr: (sum(y)/len(y), 1.0)),
        ('BayesianLogisticRegression[X_, y_, prior_]', lambda X, y, pr: [0.5]),
        ('GaussianProcess[X_, y_, kernel_]', lambda X, y, k: (sum(y)/len(y), [[1]])),
        ('GPRegressionPrediction[gp_, Xnew_]', lambda gp, X: [0]),
        ('GPClassification[X_, y_, kernel_]', lambda X, y, k: "classifier"),
        ('BayesianOptimization[f_, bounds_, n_]', lambda f, b, n: b[0]),
        ('AcquisitionFunction[mu_, sigma_]', lambda mu, sig: mu + 2*sig),
        ('ExpectedImprovement[mu_, sigma_, best_]', lambda mu, sig, b: sig),
        ('ProbabilityOfImprovement[mu_, sigma_, best_]', lambda mu, sig, b: 0.5),
        ('UpperConfidenceBound[mu_, sigma_, kappa_]', lambda mu, sig, k: mu + k*sig),
        ('ThompsonSampling[posterior_]', lambda p: 0.5),
        ('BayesianABTest[conversionsA_, trialsA_, conversionsB_, trialsB_]', lambda cA, nA, cB, nB: 0.5),
        ('BayesianChangePoint[data_]', lambda d: len(d)//2),
        ('HiddenMarkovModel[observations_, states_]', lambda obs, st: "HMM"),
        ('ForwardAlgorithm[hmm_, observations_]', lambda h, o: 0.5),
        ('BackwardAlgorithm[hmm_, observations_]', lambda h, o: 0.5),
        ('ViterbiAlgorithm[hmm_, observations_]', lambda h, o: [0, 1, 0]),
        
        # ===== EXPERIMENTAL DESIGN (40 functions) =====
        ('FactorialDesign[factors_, levels_]', lambda f, l: "design matrix"),
        ('LatinSquare[n_]', lambda n: [[i for i in range(int(n))] for _ in range(int(n))]),
        ('GraecoLatinSquare[n_]', lambda n: [[(i, j) for j in range(int(n))] for i in range(int(n))]),
        ('RandomizedBlockDesign[treatments_, blocks_]', lambda t, b: "design"),
        ('SplitPlotDesign[wholeplots_, subplots_]', lambda w, s: "design"),
        ('CrossoverDesign[treatments_, periods_]', lambda t, p: "design"),
        ('BalancedIncompleteBlock[v_, k_, lambda_]', lambda v, k, lam: "BIBD"),
        ('PlackettBurmanDesign[n_]', lambda n: [[1]*int(n)]),
        ('BoxBehnkenDesign[factors_]', lambda f: [[0]]),
        ('CentralCompositeDesign[factors_]', lambda f: [[0]]),
        ('DOptimalDesign[model_, points_]', lambda m, p: p),
        ('AOptimalDesign[model_, points_]', lambda m, p: p),
        ('EOptimalDesign[model_, points_]', lambda m, p: p),
        ('VOptimalDesign[model_, points_]', lambda m, p: p),
        ('GOptimalDesign[model_, points_]', lambda m, p: p),
        ('IOptimalDesign[model_, points_]', lambda m, p: p),
        ('ResponseSurfaceMethodology[factors_]', lambda f: "RSM design"),
        ('TaguchimMethod[factors_, noise_]', lambda f, n: "Taguchi array"),
        ('ShannonEntropy[probabilities_]', lambda p: -sum(pi*log(pi) for pi in p if pi > 0)),
        ('RenyiEntropy[probabilities_, alpha_]', lambda p, a: log(sum(pi**a for pi in p))/(1 - a)),
        ('PowerAnalysis[effect_, alpha_, power_]', lambda eff, alph, pow: 100),  # Sample size
        ('EffectSize[mean1_, mean2_, pooled_sd_]', lambda m1, m2, sd: (m1 - m2)/sd),
        ('CohensD[mean1_, mean2_, pooled_sd_]', lambda m1, m2, sd: (m1 - m2)/sd),
        ('HedgesG[mean1_, mean2_, pooled_sd_, n_]', lambda m1, m2, sd, n: (m1 - m2)/sd * (1 - 3/(4*n - 9))),
        ('GlassD elta[mean1_, mean2_, sd_control_]', lambda m1, m2, sdc: (m1 - m2)/sdc),
        ('PointBiserialCorrelation[continuous_, binary_]', lambda c, b: 0.5),
        ('PhiCoefficient[contingency_]', lambda c: 0.3),
        ('CramersV[contingency_]', lambda c: 0.4),
        ('KendallTau[x_, y_]', lambda x, y: 0.5),
        ('SpearmanRho[x_, y_]', lambda x, y: 0.6),
        ('PearsonR[x_, y_]', lambda x, y: sum((xi - sum(x)/len(x))*(yi - sum(y)/len(y)) for xi, yi in zip(x, y)) / sqrt(sum((xi - sum(x)/len(x))**2 for xi in x)*sum((yi - sum(y)/len(y))**2 for yi in y))),
        ('PartialCorrelation[x_, y_, z_]', lambda x, y, z: 0.5),
        ('CanonicalCorrelation[X_, Y_]', lambda X, Y: [0.7]),
        ('IntraclassCorrelation[groups_]', lambda g: 0.6),
        ('ConcordanceCorrelation[x_, y_]', lambda x, y: 0.9),
        ('MatthewsCorrelation[tp_, tn_, fp_, fn_]', lambda tp, tn, fp, fn: (tp*tn - fp*fn)/sqrt((tp+fp)*(tp+fn)*(tn+fp)*(tn+fn))),
        ('YulesQ[contingency_]', lambda c: 0.5),
        ('OddsRatio[a_, b_, c_, d_]', lambda a, b, c, d: (a*d)/(b*c)),
        ('RelativeRisk[a_, b_, c_, d_]', lambda a, b, c, d: (a/(a+b))/(c/(c+d))),
        ('AttributableRisk[exposed_, unexposed_]', lambda e, u: e - u),
        
        # ===== REGRESSION ANALYSIS (50 functions) =====
        ('SimpleLinearRegression[x_, y_]', lambda x, y: (sum((xi - sum(x)/len(x))*(yi - sum(y)/len(y)) for xi, yi in zip(x, y)) / sum((xi - sum(x)/len(x))**2 for xi in x), sum(y)/len(y))),
        ('MultipleLinearRegression[X_, y_]', lambda X, y: [0]),
        ('PolynomialRegression[x_, y_, degree_]', lambda x, y, d: [0]*int(d)),
        ('RidgeRegression[X_, y_, alpha_]', lambda X, y, a: [0]),
        ('LassoRegression[X_, y_, alpha_]', lambda X, y, a: [0]),
        ('ElasticNetRegression[X_, y_, alpha_, l1_ratio_]', lambda X, y, a, r: [0]),
        ('LogisticRegressionStats[X_, y_]', lambda X, y: [0]),
        ('PoissonRegression[X_, y_]', lambda X, y: [0]),
        ('NegativeBinomialRegression[X_, y_]', lambda X, y: [0]),
        ('GammaRegression[X_, y_]', lambda X, y: [0]),
        ('BetaRegression[X_, y_]', lambda X, y: [0]),
        ('QuantileRegression[X_, y_, tau_]', lambda X, y, tau: [0]),
        ('RobustRegression[X_, y_]', lambda X, y: [0]),
        ('TheilSenRegression[x_, y_]', lambda x, y: (0, 0)),
        ('PassingBablok[x_, y_]', lambda x, y: (1, 0)),
        ('DemingRegression[x_, y_, delta_]', lambda x, y, d: (1, 0)),
        ('TotalLeastSquares[X_, y_]', lambda X, y: [0]),
        ('OrthogonalRegression[x_, y_]', lambda x, y: (1, 0)),
        ('ProbitRegression[X_, y_]', lambda X, y: [0]),
        ('CLogLogRegression[X_, y_]', lambda X, y: [0]),
        ('OrdinalRegression[X_, y_]', lambda X, y: [0]),
        ('CoxProportionalHazards[X_, time_, event_]', lambda X, t, e: [0]),
        ('AFTModel[X_, time_, event_]', lambda X, t, e: [0]),  # Accelerated failure time
        ('TobitRegression[X_, y_, limit_]', lambda X, y, lim: [0]),
        ('HeckmanSelection[X_, y_, selection_]', lambda X, y, s: [0]),
        ('InstrumentalVariables[X_, y_, instruments_]', lambda X, y, inst: [0]),
        ('TwoStageL eastSquares[X_, y_, Z_]', lambda X, y, Z: [0]),
        ('ThreeStageLeastSquares[equations_]', lambda eq: [0]),
        ('GeneralizedLeastSquares[X_, y_, Omega_]', lambda X, y, Om: [0]),
        ('FeasibleGLS[X_, y_]', lambda X, y: [0]),
        ('WeightedLeastSquares[X_, y_, weights_]', lambda X, y, w: [0]),
        ('IterativelyReweightedLS[X_, y_]', lambda X, y: [0]),
        ('NonlinearLeastSquares[f_, data_, params_]', lambda f, d, p: p),
        ('GaussNewtonNLS[f_, data_, params_]', lambda f, d, p: p),
        ('LevenbergMarquardtNLS[f_, data_, params_]', lambda f, d, p: p),
        ('GeneralizedAdditiveModel[X_, y_]', lambda X, y: "GAM"),
        ('LocallyWeightedRegression[x_, y_, bandwidth_]', lambda x, y, b: (1, 0)),
        ('KernelRegression[x_, y_, kernel_]', lambda x, y, k: [0]),
        ('SplineRegression[x_, y_, knots_]', lambda x, y, kn: [0]),
        ('PiecewiseRegression[x_, y_, breakpoints_]', lambda x, y, bp: [0]),
        ('SegmentedRegression[x_, y_, k_]', lambda x, y, k: [0]),
        ('ThresholdRegression[x_, y_, threshold_]', lambda x, y, th: [0]),
        ('SwitchingRegression[x_, y_, regimes_]', lambda x, y, r: [0]),
        ('MixtureRegression[X_, y_, components_]', lambda X, y, c: [0]),
        
        # ===== TIME SERIES ADVANCED (50 functions) =====
        ('ARMA[p_, q_]', lambda p, q: f'ARMA({p},{q})'),
        ('ARIMA[p_, d_, q_]', lambda p, d, q: f'ARIMA({p},{d},{q})'),
        ('SARIMA[{p_, d_, q_}, {P_, D_, Q_}, s_]', lambda p, d, q, P, D, Q, s: f'SARIMA({p},{d},{q})x({P},{D},{Q})[{s}]'),
        ('VAR[lags_]', lambda l: f'VAR({l})'),
        ('VECM[lags_]', lambda l: f'VECM({l})'),
        ('ARCH[q_]', lambda q: f'ARCH({q})'),
        ('GARCH[p_, q_]', lambda p, q: f'GARCH({p},{q})'),
        ('EGARCH[p_, q_]', lambda p, q: f'EGARCH({p},{q})'),
        ('TGARCH[p_, q_]', lambda p, q: f'TGARCH({p},{q})'),
        ('FIGARCH[p_, d_, q_]', lambda p, d, q: f'FIGARCH({p},{d},{q})'),
        ('StateSpaceModel[F_, G_, H_, Q_, R_]', lambda F, G, H, Q, R: "state space"),
        ('KalmanFilterEstimate[y_, F_, H_, Q_, R_]', lambda y, F, H, Q, R: [0]),
        ('ExtendedKalmanFilter[y_, f_, h_, Q_, R_]', lambda y, f, h, Q, R: [0]),
        ('UnscentedKalmanFilter[y_, f_, h_, Q_, R_]', lambda y, f, h, Q, R: [0]),
        ('ParticleFilterTS[y_, f_, n_]', lambda y, f, n: [0]),
        ('ExponentialSmoothing[alpha_]', lambda a: f'ES(alpha={a})'),
        ('HoltWintersAdditive[alpha_, beta_, gamma_]', lambda a, b, g: f'HW({a},{b},{g})'),
        ('HoltWintersMultiplicative[alpha_, beta_, gamma_]', lambda a, b, g: f'HW_mult({a},{b},{g})'),
        ('DampedTrendMethod[alpha_, phi_]', lambda a, p: f'Damped({a},{p})'),
        ('CrostonMethod[data_]', lambda d: sum(d)/len(d)),
        ('TSBMethod[data_]', lambda d: sum(d)/len(d)),  # Teunter-Syntetos-Babai
        ('StructuralBreakTest[data_]', lambda d: len(d)//2),
        ('ChowTest[y_, X_, breakpoint_]', lambda y, X, bp: 1.0),
        ('QuandtAndrews[y_, X_]', lambda y, X: 1.0),
        ('BaiPerronTest[y_, X_, maxbreaks_]', lambda y, X, m: [len(y)//2]),
        ('ZivotAndrews[data_]', lambda d: len(d)//2),
        ('AugmentedDickeyFuller[data_]', lambda d: -3.5),
        ('PhillipsPerron[data_]', lambda d: -3.5),
        ('KPSS[data_]', lambda d: 0.3),
        ('JohansenTest[data_]', lambda d: 1),  # Number of cointegrating vectors
        ('EngleGrangerTest[y_, X_]', lambda y, X: -3.0),
        ('CointegrationRank[data_]', lambda d: 1),
        ('ErrorCorrectionModel[y_, X_, ec_term_]', lambda y, X, ec: [0]),
        ('ImpulseResponseFunction[var_, shock_]', lambda v, s: [0, 0.5, 0.3, 0.1]),
        ('VarianceDecomposition[var_]', lambda v: [[0.7, 0.3], [0.4, 0.6]]),
        ('ForecastErrorVariance[model_, h_]', lambda m, h: 1.0),
        ('RollingWindowRegression[y_, X_, window_]', lambda y, X, w: [0]),
        ('ExpandingWindowRegression[y_, X_]', lambda y, X: [0]),
        ('RecursiveRegression[y_, X_]', lambda y, X: [[0]]),
        ('State DependentModel[y_, X_, states_]', lambda y, X, s: [0]),
        ('RegimeSwitchingModel[y_, regimes_]', lambda y, r: "regime model"),
        ('ThresholdAutoregression[y_, threshold_]', lambda y, th: [0]),
        ('SmoothTransitionAutoregression[y_, transition_]', lambda y, tr: [0]),
        ('MarkovSwitching[y_, states_]', lambda y, s: "MS model"),
        ('HamiltonFilter[y_, states_]', lambda y, s: [0, 1, 0]),
        ('TimeVaryingParameter[y_, X_]', lambda y, X: [[0]]),
        ('DynamicLinearModel[y_, F_, G_]', lambda y, F, G: "DLM"),
        ('BayesianStructuralTimeSeries[y_]', lambda y: "BSTS"),
        ('UnobservedComponents[y_]', lambda y: (trend, seasonal, irregular)),
        ('LocalLevelModel[y_]', lambda y: [sum(y)/len(y)]*len(y)),
        ('LocalLinearTrend[y_]', lambda y: list(range(len(y)))),
        
        # ===== SURVIVAL ANALYSIS (50 functions) =====
        ('SurvivalFunction[t_, lambda_]', lambda t, lam: exp(-lam*t)),
        ('HazardFunction[t_, lambda_]', lambda t, lam: lam),
        ('CumulativeHazard[t_, lambda_]', lambda t, lam: lam*t),
        ('KaplanMeierEstimator[times_, events_]', lambda t, e: [1.0]*len(t)),
        ('NelsonAalenEstimator[times_, events_]', lambda t, e: list(range(len(t)))),
        ('LogRankTest[times1_, events1_, times2_, events2_]', lambda t1, e1, t2, e2: 1.0),
        ('WilcoxonTest[times1_, events1_, times2_, events2_]', lambda t1, e1, t2, e2: 1.0),
        ('TaroneWareTest[times1_, events1_, times2_, events2_]', lambda t1, e1, t2, e2: 1.0),
        ('PetoTest[times1_, events1_, times2_, events2_]', lambda t1, e1, t2, e2: 1.0),
        ('FlemingHarrington[times1_, events1_, times2_, events2_, p_, q_]', lambda t1, e1, t2, e2, p, q: 1.0),
        ('CoxRegression[X_, times_, events_]', lambda X, t, e: [0]),
        ('CoxSnellResiduals[model_]', lambda m: [0]),
        ('SchoenfelResiduals[model_]', lambda m: [0]),
        ('MartingaleResiduals[model_]', lambda m: [0]),
        ('DevianceResiduals[model_]', lambda m: [0]),
        ('ProportionalHazardsAssumption[model_]', lambda m: True),
        ('TimeVaryingCovariate[X_, times_]', lambda X, t: X),
        ('StratifiedCox[X_, times_, events_, strata_]', lambda X, t, e, s: [0]),
        ('CompetingRisks[times_, events_, causes_]', lambda t, e, c: "competing risks model"),
        ('CumulativeIncidence[times_, events_, cause_]', lambda t, e, c: [0.1, 0.2, 0.3]),
        ('GrayTest[times_, events_, causes_]', lambda t, e, c: 1.0),
        ('FineGrayModel[X_, times_, events_, cause_]', lambda X, t, e, c: [0]),
        ('MultiState Model[transitions_]', lambda tr: "multi-state model"),
        ('IllnessDeath[times_, states_]', lambda t, s: "illness-death model"),
        ('RecurrentEvents[times_, events_, subject_]', lambda t, e, s: "recurrent events"),
        ('FrailtModel[X_, times_, events_, frailty_]', lambda X, t, e, f: [0]),
        ('SharedFrailty[groups_, times_, events_]', lambda g, t, e: "shared frailty"),
        ('AcceleratedFailureTime[X_, times_, events_]', lambda X, t, e: [0]),
        ('WeibullAFT[X_, times_, events_]', lambda X, t, e: [0]),
        ('LogNormalAFT[X_, times_, events_]', lambda X, t, e: [0]),
        ('LogLogisticAFT[X_, times_, events_]', lambda X, t, e: [0]),
        ('GeneralizedGammaAFT[X_, times_, events_]', lambda X, t, e: [0]),
        ('ParametricSurvival[times_, events_, distribution_]', lambda t, e, d: f'Parametric({d})'),
        ('CureModel[X_, times_, events_]', lambda X, t, e: "cure model"),
        ('MixtureC ureModel[X_, times_, events_]', lambda X, t, e: "mixture cure"),
        ('PromotionTimeModel[X_, times_, events_]', lambda X, t, e: "promotion time"),
        ('LandmarkAnalysis[times_, events_, landmark_]', lambda t, e, lm: "landmark"),
    ]


def register():
    """Register all extended15 rules"""
    from .extended_helper import convert_rules
    return convert_rules(get_rules())
