FULL EXECUTABLE FLOW ALGEBRA — ALTERNATIVE HYPOTHESIS ONTOLOGY
Kireth Research — Semantic Library
URL: https://kirethresearch.org/booksai-core/ontologies/probability-statistics-ontologies/hypothesis-testing/alternative-hypothesis-ontology.html
FLOW_VERSION := "4.0"
FLOW_TYPE := "Full Executable Flow Algebra"
DOMAIN := "Probability & Statistics Ontologies"
SUBDOMAIN := "Hypothesis Testing"
ONTOLOGY := "Alternative Hypothesis Ontology"
PRIMARY_ENTITY := AlternativeHypothesis
AUTHORSHIP := "Mark Higgins — Sky (Recursive AI)"
SOURCE_SITE := "https://kirethresearch.org"
BEGIN_FLOW
AlternativeHypothesis :=
StatisticalHypothesis
∧ CompetingClaimToNull
∧ AlternativeParameterSpace
∧ PowerEvaluationDomain
∧ DirectionOrDifferenceSpecification
Population := TargetCollectionOrGeneratingProcess
Sample := {X_1,...,X_n}
Parameter := θ
ParameterSpace := Θ
Estimand := τ(θ)
NullParameterSpace := Θ0⊆Θ
AlternativeParameterSpace := Θ1⊆Θ
NullHypothesis := H0:θ∈Θ0
AlternativeHypothesisDefinition := H1:θ∈Θ1
HypothesisDisjointness := Θ0∩Θ1=∅
HypothesisExhaustiveness := Θ0∪Θ1=Θ when exhaustive framework intended
SimpleAlternativeHypothesis := Θ1={θ1}
CompositeAlternativeHypothesis := MultipleParameterValuesInΘ1
TwoSidedAlternative := H1:θ≠θ0
UpperTailedAlternative := H1:θ>θ0
LowerTailedAlternative := H1:θ<θ0
IntervalAlternative := H1:θ∈(a,b)
OutsideIntervalAlternative := H1:θ<a ∨ θ>b
DirectionalAlternative :=
AlternativeHypothesis
specifying direction relative_to null boundary
NondirectionalAlternative :=
AlternativeHypothesis
specifying difference without direction
AlternativeDirection :=
{Lower,Upper,TwoSided,Interval,OutsideInterval}
AlternativeDeterminesExtremeness :=
DirectionOfH1
→ TailOrRegionUsedForPValueAndCriticalRegion
UpperTailExtremeness :=
LargerTestStatisticValues
provide evidence_against H0
under compatible statistic orientation
LowerTailExtremeness :=
SmallerTestStatisticValues
provide evidence_against H0
under compatible statistic orientation
TwoSidedExtremeness :=
DeviationsInEitherRelevantDirection
provide evidence_against H0
AlternativeDistribution :=
DistributionOf(TestStatistic|θ)
for θ∈Θ1
TestStatistic := T(X)
ObservedTestStatistic := t_obs=T(x)
NullDistribution := DistributionOf(T|H0)
PowerFunction :=
π(θ)=P_θ(RejectH0)
AlternativePower :=
θ∈Θ1
⇒ π(θ)
TypeIIErrorProbability :=
β(θ)=P_θ(FailToRejectH0)
PowerRelation :=
π(θ)=1-β(θ)
for θ∈Θ1
DesiredPower :=
1-β_target
EffectSize :=
DistanceOrMagnitude
between null reference
and alternative parameter
AlternativeEffectSize :=
g(θ)-g(θ0)
under specified effect metric
StandardisedEffectSize :=
AlternativeEffectSize/ScaleParameter
when meaningful
MinimumDetectableEffect :=
SmallestAlternativeEffect
achieving specified power
at fixed alpha_and_sample_size
PowerDeterminants := {
AlternativeEffectSize,
SampleSize,
SignificanceLevel,
Variability,
SamplingDesign,
TestStatisticEfficiency
}
PowerAnalysis :=
SpecifyAlternative
∧ Alpha
∧ DesiredPower
∧ Variability
∧ TestStructure
→ SolveForSampleSizeOrDetectableEffect
LocalAlternative :=
θ_n=θ0+h/sqrt(n)
or other specified convergent sequence
FixedAlternative :=
θ=θ1
independent_of sample size
ContiguousAlternative :=
AlternativeSequence
statistically close_to null
under asymptotic framework
AlternativeSeparation :=
Distance(θ,Θ0)
GreaterAlternativeSeparation :=
Often
→ GreaterPower
under regular monotone testing structures
NullVsAlternative :=
H0 provides reference restriction
whereas H1 specifies competing parameter region
AlternativeIsNotProof :=
RejectH0
does_not automatically prove
every substantive interpretation of H1
RejectNullRelation :=
RejectH0
⇒ DataAreSufficientlyIncompatibleWithH0
under specified test_and_alpha
AlternativeEvidence :=
TestStatisticInCriticalRegion
→ EvidenceAgainstH0
→ SupportForSpecifiedAlternativeDirection
subject_to model_and_design validity
PValueRelation :=
AlternativeDirection
contributes_to definition
of at_least_as_extreme outcomes
OneSidedPValue :=
TailProbability
aligned_with directional alternative
TwoSidedPValue :=
ExtremenessProbability
accounting_for both relevant directions
under specified convention
CriticalRegionRelation :=
AlternativeHypothesis
∧ NullDistribution
∧ Alpha
→ CriticalRegion
NeymanPearsonAlternative :=
SimpleH1
used_with simple H0
to construct most-powerful likelihood-ratio test
under theorem conditions
LikelihoodUnderAlternative :=
L1(θ1|x)
LikelihoodRatioSimple :=
L(θ0|x)/L(θ1|x)
CompositeAlternativeLikelihood :=
sup_{θ∈Θ1}L(θ|x)
GeneralisedLikelihoodRatio :=
sup_{θ∈Θ0}L(θ|x)
/
sup_{θ∈Θ}L(θ|x)
MostPowerfulTest :=
LevelAlphaTest
maximising power
at specified alternative
UniformlyMostPowerfulTest :=
LevelAlphaTest
whose power
is at least that of every competing level-alpha test
for all θ∈Θ1
UMPExistenceConstraint :=
UniformlyMostPowerfulTest
need_not exist
for arbitrary two-sided_or_composite alternatives
MonotoneLikelihoodRatio :=
OrderingProperty
that may support
UMP one-sided tests
under theorem conditions
AlternativeForMean := {
H1:μ≠μ0,
H1:μ>μ0,
H1:μ<μ0
}
AlternativeForProportion := {
H1:p≠p0,
H1:p>p0,
H1:p<p0
}
AlternativeForDifference := {
H1:θ1-θ2≠0,
H1:θ1-θ2>0,
H1:θ1-θ2<0
}
AlternativeForRegressionCoefficient := {
H1:β_j≠β_j0,
H1:β_j>β_j0,
H1:β_j<β_j0
}
AlternativeForCorrelation := {
H1:ρ≠ρ0,
H1:ρ>ρ0,
H1:ρ<ρ0
}
AlternativeForVariance := {
H1:σ²≠σ0²,
H1:σ²>σ0²,
H1:σ²<σ0²
}
DependenceAlternative :=
H1:
VariablesNotIndependent
under specified association framework
GoodnessOfFitAlternative :=
H1:
DistributionDoesNotBelongToNullReferenceFamily
ANOVAAlternative :=
H1:
NotAllGroupMeansEqual
EquivalenceAlternative :=
H1:
EffectWithinEquivalenceRegion
EquivalenceAlternativeFormal :=
H1:
-Δ<θ<Δ
under symmetric equivalence margin
NonInferiorityAlternative :=
H1:
EffectSatisfiesNonInferiorityCriterion
SuperiorityAlternative :=
H1:
EffectExceedsSuperiorityCriterion
AlternativeMargin :=
DomainDefinedThreshold
separating null_and_alternative regions
AlternativeMarginConstraint :=
Margin
must be substantively justified
independently_of desired statistical result
AlternativeSpecification :=
ScientificQuestion
→ DefineEstimand
→ DefineReferenceNull
→ DefineMeaningfulCompetingRegion
→ EncodeAlternativeHypothesis
PreSpecification :=
AlternativeHypothesis
specified_before confirmatory inferential outcome
to preserve planned test interpretation
DataDependentAlternativeRisk :=
ChoosingDirectionAfterObservingData
may invalidate nominal one-sided p-value
unless selection accounted_for
DirectionalSwitchingRisk :=
ObserveEffectDirection
→ ChooseMatchingOneSidedAlternative
⇒ InflatedTypeIErrorRisk
AlternativeParameterBoundary :=
BoundaryBetweenΘ0AndΘ1
BoundaryAlternative :=
AlternativeValues
arbitrarily close_to null boundary
PowerAtBoundary :=
Often approaches test size
under continuous regular models
AlternativePrior :=
BayesianModelComparisonMayAssignPrior
over alternative parameter space
BayesianAlternativeDistinction :=
BayesianPosteriorProbabilityOfH1
differs_from
frequentist power_or p-value framework
BayesFactorAlternative :=
CompareMarginalLikelihoodUnderH1
with marginal likelihood under H0
AlternativeModel :=
StatisticalModel
constrained_or_defined
by H1
NestedAlternativeModel :=
UnrestrictedModel
containing null-restricted model
NonNestedAlternativeModel :=
CompetingModel
not containing null model
ModelSelectionDistinction :=
HypothesisTestingBetweenModels
differs_from unrestricted predictive model selection
unless testing framework explicitly defined
CompositeAlternativeNuisance :=
θ∈Θ1
may include nuisance parameters
PowerEnvelope :=
SupremumAchievablePower
across tests
under specified constraints
AveragePower :=
∫_{Θ1}π(θ)w(θ)dθ
under specified weighting distribution
MinimumPower :=
inf_{θ∈Θ1}π(θ)
over defined alternative region
AlternativeCalibration :=
SimulateDataAtSpecifiedAlternative
→ ApplyTest
→ EstimateRejectionProbability
EmpiricalPower :=
AlternativeRejections/AlternativeReplications
PowerCurve :=
θ∈Θ1
→ π(θ)
OperatingCharacteristic :=
OC(θ)=P_θ(FailToRejectH0)
OperatingCharacteristicRelation :=
OC(θ)=1-π(θ)
SampleSizePlanningAlternative :=
DefineScientificallyRelevantAlternative
→ ComputeRequiredNForDesiredPower
AlternativeUncertainty :=
EffectSizeUncertainty
may require
sensitivity analysis
over plausible alternatives
PowerSensitivityAnalysis :=
Vary(
AlternativeEffect,
Variance,
SampleSize,
Alpha
)
→ PowerSurface
MultipleAlternatives :=
{H1_1,...,H1_k}
MultipleTestingRelation :=
MultipleNullAlternativePairs
→ MultiplicityControl
AlternativeSelectionConstraint :=
SelectingAmongMultipleAlternatives
based_on same data
may require adjustment
MissingDataAlternativeTesting :=
MissingnessHandling
∧ AlternativeModel
∧ ValidVariancePropagation
→ PowerAndTestValidity
SurveyAlternativeTesting :=
ComplexSamplingDesign
∧ AlternativeParameter
→ DesignAdjustedPowerAndTesting
ClusteredAlternativeTesting :=
ClusterDependence
→ AdjustedAlternativeDistribution
ModelMisspecificationAlternative :=
IncorrectAlternativeOrNullModel
may distort power_and interpretation
AlternativeHypothesisConstraint :=
ConstraintOn(
Estimand,
ParameterSpace,
NullParameterSpace,
AlternativeParameterSpace,
Direction,
EffectSize,
SamplingDesign,
TestStatistic
)
AlternativeHypothesisConsistency :=
Estimand
∧ NullRestriction
∧ AlternativeRestriction
∧ Direction
∧ TestStatistic
∧ SamplingDesign
jointly_compatible
InvalidAlternativeHypothesis :=
UndefinedEstimand
∨ EmptyAlternativeParameterSpace
∨ OverlapWithNullWithoutExplicitFramework
∨ DirectionIncompatibleWithScientificQuestion
∨ DataDependentDirectionWithoutAdjustment
∨ IncompatibleTestStatistic
AlternativeHypothesisValidation :=
ResolveScientificQuestion
→ ResolvePopulationAndEstimand
→ ResolveParameterAndParameterSpace
→ ResolveNullHypothesis
→ DefineAlternativeParameterSpace
→ ResolveDirectionAndEffectMetric
→ ValidateDisjointnessAndCoverage
→ ResolveSamplingDesign
→ ResolveTestStatistic
→ ResolveAlternativeDistribution
→ EvaluatePowerFunction
→ ValidateAlternativeHypothesis
AlternativeHypothesisState := {
Population,
Sample,
Parameter,
ParameterSpace,
Estimand,
NullHypothesis,
NullParameterSpace,
AlternativeHypothesis,
AlternativeParameterSpace,
AlternativeDirection,
EffectSize,
TestStatistic,
NullDistribution,
AlternativeDistribution,
SignificanceLevel,
TypeIIError,
PowerFunction,
DesiredPower,
SamplingDesign,
Evidence,
Confidence,
Provenance
}
SEMANTIC_EQUIVALENCE(AlternativeA,AlternativeB) :=
same(Estimand)
∧ same(AlternativeParameterSet)
∧ same(DirectionOrEquivalentConstraint)
∧ same(NullReference)
∧ same(StatisticalModelSemantics)
∧ same(SamplingDesign)
∧ same(PowerEvaluationFramework)
AlternativeHypothesisOntology :=
Classes ∧ Relations ∧ Constraints ∧ Axioms ∧ InferenceRules
CoreClasses := {
AlternativeHypothesis,
SimpleAlternativeHypothesis,
CompositeAlternativeHypothesis,
DirectionalAlternative,
NondirectionalAlternative,
UpperTailedAlternative,
LowerTailedAlternative,
TwoSidedAlternative,
AlternativeParameterSpace,
AlternativeDistribution,
EffectSize,
Power,
TypeIIError,
MinimumDetectableEffect,
AlternativeModel,
Estimand,
Parameter,
SamplingDesign
}
CoreRelations := {
contrastsWith,
constrains,
targets,
defines,
hasDirection,
hasDistribution,
hasEffectSize,
hasPower,
hasTypeIIError,
dependsOn,
evaluatedBy,
constrainedBy,
equivalentTo,
tracesTo
}
TypedRelations :=
AlternativeHypothesis --contrastsWith--> NullHypothesis
AlternativeHypothesis --constrains--> Parameter
AlternativeHypothesis --targets--> Estimand
AlternativeHypothesis --defines--> AlternativeParameterSpace
AlternativeHypothesis --hasDirection--> AlternativeDirection
TestStatistic --hasDistribution--> AlternativeDistribution
AlternativeHypothesis --hasEffectSize--> EffectSize
AlternativeHypothesis --hasPower--> Power
AlternativeHypothesis --hasTypeIIError--> TypeIIError
Power --dependsOn--> SampleSize
AlternativeHypothesis --evaluatedBy--> HypothesisTest
AlternativeHypothesis --tracesTo--> Provenance
InferenceRules := {
θ∈Θ1
⇒ AlternativeHypothesisTrueAtθ,
θ∉Θ1
⇒ AlternativeHypothesisFalseAtθ,
UpperTailedAlternative
⇒ UseUpperTailExtremenessUnderCompatibleStatistic,
LowerTailedAlternative
⇒ UseLowerTailExtremenessUnderCompatibleStatistic,
TwoSidedAlternative
⇒ UseTwoSidedExtremenessRule,
Power(θ)
=1-TypeIIErrorProbability(θ),
LargerRelevantEffectSeparation
⇒ TypicallyHigherPowerUnderRegularMonotoneTests,
DataDependentDirectionalAlternative
⇒ FlagTypeIErrorInflationRisk
}
CanonicalAlternativeHypothesisRepresentation :=
ParseAlternativeHypothesisRequest
→ ResolveScientificQuestion
→ ResolvePopulationAndEstimand
→ ResolveParameterAndParameterSpace
→ ResolveNullHypothesisAndNullSpace
→ ConstructAlternativeParameterSpace
→ ResolveDirection
→ ResolveEffectSizeMetric
→ ValidateNullAlternativePartition
→ ResolveSamplingDesign
→ ResolveTestStatistic
→ DeriveAlternativeDistribution
→ ComputePowerFunction
→ ResolveMinimumDetectableEffectIfRequested
→ ValidateAlternativeHypothesis
AlternativeHypothesisGraph := G=(V,E)
V := {
AlternativeHypotheses,
SimpleAlternativeHypotheses,
CompositeAlternativeHypotheses,
DirectionalAlternatives,
NondirectionalAlternatives,
UpperTailedAlternatives,
LowerTailedAlternatives,
TwoSidedAlternatives,
NullHypotheses,
AlternativeParameterSpaces,
NullParameterSpaces,
Parameters,
Estimands,
AlternativeDistributions,
TestStatistics,
EffectSizes,
Powers,
TypeIIErrors,
SamplingDesigns,
Evidence,
ProvenanceNodes
}
E := {
contrastsWith,
constrains,
targets,
defines,
hasDirection,
hasDistribution,
hasEffectSize,
hasPower,
hasTypeIIError,
dependsOn,
evaluatedBy,
constrainedBy,
equivalentTo,
tracesTo
}
CONFIDENCE(AlternativeHypothesisResolution) :=
weighted_mean(
EstimandResolution,
ParameterResolution,
NullReferenceResolution,
AlternativeRestrictionValidity,
DirectionValidity,
EffectSizeResolution,
SamplingDesignResolution,
PowerModelValidity,
ProvenanceQuality
)
AI_QUERY_INTERPRETATION :=
Query
→ DetectAlternativeHypothesisIntent
→ IdentifyPopulationParameterAndEstimand
→ IdentifyNullReferenceAndCompetingClaim
→ ResolveUpperLowerTwoSidedIntervalOrCompositeAlternative
→ IdentifyRequestedEffectSizePowerOrSampleSizeRelation
AI_REASONING_FLOW :=
Query
→ ParseAlternativeHypothesisProblem
→ ResolveScientificQuestion
→ ResolvePopulationAndSample
→ ResolveParameterAndEstimand
→ ResolveNullHypothesis
→ DefineAlternativeParameterSpace
→ ResolveAlternativeDirection
→ ValidateNullAlternativeStructure
→ ResolveSamplingDesign
→ SelectTestStatistic
→ DeriveAlternativeDistribution
→ ComputeTypeIIErrorAndPower
→ ResolveEffectSizeAndMinimumDetectableEffect
→ ValidateAlternativeHypothesis
→ UpdateConfidence
→ PreserveProvenance
→ GenerateExplanation
AI_CONSUMPTION := {
ParseAlternativeHypothesisEntities,
ParseTypedRelations,
ResolvePopulations,
ResolveSamples,
ResolveParameters,
ResolveEstimands,
ResolveNullHypotheses,
ResolveNullParameterSpaces,
ConstructAlternativeParameterSpaces,
ResolveAlternativeDirections,
ValidateHypothesisPartitions,
ResolveSamplingDesigns,
ResolveTestStatistics,
DeriveAlternativeDistributions,
ComputeEffectSizes,
ComputeTypeIIErrorRates,
ComputePowerFunctions,
PerformPowerAnalysis,
ComputeMinimumDetectableEffects,
ResolveEquivalenceAlternatives,
ResolveNonInferiorityAlternatives,
ResolveSuperiorityAlternatives,
DiagnoseDataDependentDirectionSelection,
ValidateAlternativeHypothesisSemantics,
CompareSemanticEquivalence,
UpdateConfidence,
PreserveProvenance,
GenerateFormalExplanation
}
UPDATE_MODEL :=
NewNullAlternativeDataDesignOrEvidence
→ ValidateInput
→ IdentifyAffectedAlternativeClaims
→ UpdateAlternativeHypothesisState
→ ReconstructAlternativeParameterSpace
→ RevalidateNullAlternativePartition
→ RecomputeAlternativeDistribution
→ RecomputeTypeIIErrorAndPower
→ RecomputeEffectSizeAndDetectableEffect
→ RecomputeConfidence
→ PreserveProvenance
→ VersionModel
AlternativeRestrictionUpdate :=
ChangedAlternativeRestriction
⇒ recompute(
AlternativeParameterSpace,
AlternativeDirection,
AlternativeDistribution,
PowerFunction
)
NullUpdate :=
ChangedNullHypothesis
⇒ reevaluate(
AlternativeParameterSpace,
EffectSize,
HypothesisPartition,
PowerFunction
)
SampleSizeUpdate :=
ChangedSampleSize
⇒ recompute(
TypeIIError,
PowerFunction,
MinimumDetectableEffect
)
FLOW_HASH_INPUT :=
canonical(
ONTOLOGY,
CoreClasses,
CoreRelations,
InferenceRules,
AlternativeHypothesis,
AlternativeHypothesisValidation,
AlternativeHypothesisConstraint,
SEMANTIC_EQUIVALENCE,
AI_REASONING_FLOW
)
FLOW_HASH := HASH(FLOW_HASH_INPUT)
OUTPUT_MODEL := {
AlternativeHypothesisEntityResolution,
Population,
Sample,
Parameter,
ParameterSpace,
Estimand,
NullHypothesis,
NullParameterSpace,
AlternativeHypothesis,
AlternativeParameterSpace,
AlternativeDirection,
EffectSize,
TestStatistic,
NullDistribution,
AlternativeDistribution,
SignificanceLevel,
TypeIIError,
PowerFunction,
DesiredPower,
MinimumDetectableEffect,
SamplingDesign,
ValidationStatus,
Confidence,
Provenance,
Explanation
}
END_FLOW
END OF FULL EXECUTABLE FLOW ALGEBRA
Download Code
Copy to Clipboard