FULL EXECUTABLE FLOW ALGEBRA — STUDENT'S T-DISTRIBUTION ONTOLOGY
Kireth Research — Semantic Library
URL: https://kirethresearch.org/booksai-core/ontologies/probability-statistics-ontologies/probability-distributions/students-t-distribution-ontology.html
FLOW_VERSION := "4.0"
FLOW_TYPE := "Full Executable Flow Algebra"
DOMAIN := "Probability & Statistics Ontologies"
SUBDOMAIN := "Probability Distributions"
ONTOLOGY := "Student's T-Distribution Ontology"
PRIMARY_ENTITY := StudentsTDistribution
AUTHORSHIP := "Mark Higgins — Sky (Recursive AI)"
SOURCE_SITE := "https://kirethresearch.org"
BEGIN_FLOW
StudentsTDistribution :=
ContinuousProbabilityDistribution
∧ SymmetricHeavyTailedDistribution
∧ DegreesOfFreedomParameter
∧ NormalChiSquaredRatioConstruction
∧ SmallSampleInferenceDistribution
ProbabilitySpace := (Ω,F,P)
TRandomVariable :=
T~t_ν
DegreesOfFreedom :=
ν
ParameterConstraint :=
ν>0
Support :=
R
StandardNormalComponent :=
Z~N(0,1)
ChiSquaredComponent :=
V~χ²_ν
IndependenceCondition :=
Z⟂V
TConstruction :=
T
=
Z
/
sqrt(V/ν)
RatioDistribution :=
Z~N(0,1)
∧ V~χ²_ν
∧ Z⟂V
⇒
Z/sqrt(V/ν)
~
t_ν
StudentTPDF :=
f_T(t)
=
Γ((ν+1)/2)
/
[
sqrt(νπ)
Γ(ν/2)
]
×
(1+t²/ν)^(-(ν+1)/2)
PDFNonnegativity :=
f_T(t)>0
for all t∈R
PDFNormalisation :=
Integral_{-∞}^{∞}
f_T(t)dt
=
1
TCDF :=
F_T(t)
=
P(T≤t)
Symmetry :=
f_T(-t)
=
f_T(t)
CDFSymmetry :=
F_T(-t)
=
1-F_T(t)
Median :=
0
Mode :=
0
Mean :=
0
when ν>1
MeanUndefined :=
0<ν≤1
⇒
ordinary expectation undefined
Variance :=
ν/(ν-2)
when ν>2
InfiniteVariance :=
1<ν≤2
⇒
variance infinite
VarianceUndefined :=
0<ν≤1
⇒
ordinary variance undefined
Skewness :=
0
when defined
ExcessKurtosis :=
6/(ν-4)
when ν>4
HeavyTails :=
StudentT
has heavier tails
than StandardNormal
for finite ν
TailDecay :=
f_T(t)
asymptotically proportional_to
|t|^(-(ν+1))
DegreesOfFreedomEffect :=
Increasingν
→ thinner tails
→ closer_to StandardNormal
NormalLimit :=
ν→∞
⇒
t_ν
→ N(0,1)
in distribution
CauchySpecialCase :=
t_1
≡
StandardCauchy
LocationScaleT :=
X
=
μ+sT
where
T~t_ν
∧ s>0
LocationScaleTPDF :=
f_X(x)
=
(1/s)
f_T((x-μ)/s)
TQuantile :=
q_p
such_that
P(T≤q_p)=p
CriticalValue :=
t_(p,ν)
TwoSidedCriticalValue :=
t_(1-α/2,ν)
OneSidedCriticalValue :=
t_(1-α,ν)
NormalSample :=
X_1,...,X_n
iid N(μ,σ²)
SampleMean :=
X_bar
=
(1/n)Σ_iX_i
SampleVariance :=
S²
=
[1/(n-1)]
Σ_i(X_i-X_bar)²
NormalSampleMeanDistribution :=
(X_bar-μ)/(σ/√n)
~
N(0,1)
SampleVarianceChiSquared :=
(n-1)S²/σ²
~
χ²_(n-1)
NormalMeanVarianceIndependence :=
X_bar
⟂
S²
OneSampleTStatistic :=
T
=
(X_bar-μ)
/
(S/√n)
OneSampleTDistribution :=
Under normal iid assumptions:
T~t_(n-1)
OneSampleDegreesOfFreedom :=
ν=n-1
OneSampleMeanConfidenceInterval :=
X_bar
±
t_(1-α/2,n-1)
S/√n
OneSampleTTest :=
H0:μ=μ0
→ Compute
T
=
(X_bar-μ0)/(S/√n)
TwoSampleIndependentT :=
DifferenceOfSampleMeans
standardised_by
estimated standard error
PooledTTest :=
IndependentNormalSamples
∧ EqualVarianceAssumption
→ PooledVarianceTStatistic
PooledDegreesOfFreedom :=
n1+n2-2
WelchTTest :=
IndependentSamples
∧ UnequalVarianceAllowed
→ WelchTStatistic
WelchStatistic :=
T
=
(X_bar1-X_bar2)
/
sqrt(
S1²/n1
+
S2²/n2
)
WelchSatterthwaiteDF :=
ν
approximately
=
(S1²/n1+S2²/n2)²
/
[
(S1²/n1)²/(n1-1)
+
(S2²/n2)²/(n2-1)
]
PairedTTest :=
PairedObservations
→ Differences D_i
→ OneSampleTTestOnDifferences
PairedDegreesOfFreedom :=
n_pairs-1
RegressionTRelation :=
EstimatedRegressionCoefficient
standardised_by
its estimated standard error
may follow t distribution
under linear-model assumptions
RegressionTStatistic :=
t
=
(β_hat_j-β_j0)
/
SE(β_hat_j)
RegressionDegreesOfFreedom :=
ResidualDegreesOfFreedom
CorrelationTRelation :=
Under bivariate-normal null assumptions:
t
=
r
sqrt(
(n-2)/(1-r²)
)
~
t_(n-2)
BayesianTRelation :=
StudentTDistribution
arises as
marginal_or_predictive distribution
when Gaussian variance uncertainty
is integrated out
under conjugate models
NormalInverseGammaRelation :=
GaussianLikelihood
∧ NormalInverseGammaPrior
→ StudentTPredictive
ScaleMixtureRepresentation :=
StudentT
=
NormalDistribution
with random inverse-gamma-related variance
GaussianScaleMixture :=
T|τ
~
N(0,1/τ)
∧ τ
~
Gamma(ν/2,ν/2)
⇒
T~t_ν
RobustModellingRelation :=
HeavyTails
make StudentT likelihood
less sensitive to extreme observations
than Gaussian likelihood
in some models
StudentTLikelihood :=
Data
modelled_with
location-scale StudentT distribution
LogLikelihood :=
SumOfLogStudentTDensities
over observations
FDistributionRelation :=
T~t_ν
⇒
T²
~
F_(1,ν)
ChiSquaredRelation :=
TConstruction
directly depends_on
χ²_ν denominator component
NormalRelation :=
ν→∞
⇒
StudentTApproachesNormal
TDistributionMomentExistence :=
E[|T|^k]
finite
iff
k<ν
OddMoments :=
Symmetry
⇒
existing odd moments
equal 0
Entropy :=
DefinedUsing
BetaAndDigammaFunctions
for ν>0
StudentTConstraint :=
ConstraintOn(
DegreesOfFreedom,
Support,
PDF,
MomentExistence,
InferentialAssumptions
)
DegreesOfFreedomConstraint :=
ν>0
SupportConstraint :=
T∈R
NormalisationConstraint :=
Integral f_T(t)dt=1
MomentConstraint :=
RequestedMomentOrder
must satisfy
existence conditions
InferenceAssumptionConstraint :=
ExactClassicalTInference
requires
relevant sampling assumptions
StudentTConsistency :=
DegreesOfFreedom
∧ PDF
∧ CDF
∧ Moments
∧ SamplingConstruction
jointly_compatible
InvalidStudentTDistribution :=
ν≤0
∨ PDFNormalisationFailure
∨ InvalidMomentClaim
∨ IncompatibleConstruction
StudentTValidation :=
ResolveDegreesOfFreedom
→ ValidateDegreesOfFreedom
→ ResolveSupport
→ ConstructPDF
→ ValidateNormalisation
→ ValidateMomentExistence
→ ResolveSamplingConstruction
→ ValidateInferentialAssumptionsIfApplicable
StudentTDistributionState := {
RandomVariable,
DegreesOfFreedom,
Location,
Scale,
Support,
PDF,
CDF,
Moments,
SamplingStatistic,
InferenceContext,
Evidence,
Confidence,
Provenance
}
StudentTEvidence :=
NormalSampleWithUnknownVariance
∨ RegressionModel
∨ CorrelationModel
∨ BayesianPredictiveModel
∨ HeavyTailedDataModel
∨ TheoreticalDerivation
StudentTUpdate :=
NewDataDegreesOfFreedomOrModelEvidence
→ UpdateState
→ RecomputePDF
→ RecomputeCDF
→ RecomputeCriticalValues
→ RevalidateMomentsAndInference
SEMANTIC_EQUIVALENCE(StudentTA,StudentTB) :=
same(DegreesOfFreedom)
∧ same(LocationScaleParameters)
⇒
same(StudentTProbabilityMeasure)
StudentsTDistributionOntology :=
Classes
∧ Relations
∧ Constraints
∧ Axioms
∧ InferenceRules
CoreClasses := {
StudentsTDistribution,
ContinuousDistribution,
TRandomVariable,
DegreesOfFreedom,
StudentTPDF,
TCDF,
StandardNormal,
ChiSquaredDistribution,
SampleMean,
SampleVariance,
TStatistic,
TTest,
TConfidenceInterval,
FDistribution,
StudentTLikelihood,
StudentTConstraint
}
CoreRelations := {
distributionOf,
hasDegreesOfFreedom,
hasSupport,
hasPDF,
hasCDF,
constructedFrom,
derivedFrom,
usedFor,
convergesTo,
squaredAs,
sampledFrom,
estimatedFrom,
constrainedBy,
equivalentTo,
tracesTo
}
TypedRelations :=
StudentsTDistribution --distributionOf--> TRandomVariable
StudentsTDistribution --hasDegreesOfFreedom--> DegreesOfFreedom
StudentsTDistribution --hasSupport--> Support
StudentsTDistribution --hasPDF--> StudentTPDF
StudentsTDistribution --hasCDF--> TCDF
StudentsTDistribution --constructedFrom--> StandardNormal
StudentsTDistribution --constructedFrom--> ChiSquaredDistribution
TStatistic --derivedFrom--> SampleMean
TStatistic --derivedFrom--> SampleVariance
StudentsTDistribution --usedFor--> MeanInference
StudentsTDistribution --convergesTo--> StandardNormal
TRandomVariable --squaredAs--> FDistribution
StudentsTDistribution --tracesTo--> Provenance
InferenceRules := {
Z~N(0,1)
∧ V~χ²_ν
∧ Z⟂V
⇒
Z/sqrt(V/ν)~t_ν,
Xi iid N(μ,σ²)
⇒
(X_bar-μ)/(S/√n)
~
t_(n-1),
T~t_ν
∧ ν>1
⇒
E[T]=0,
T~t_ν
∧ ν>2
⇒
Var(T)=ν/(ν-2),
T~t_ν
⇒
T²~F_(1,ν),
ν→∞
⇒
t_ν→N(0,1),
ν≤0
⇒
InvalidStudentTDistribution
}
CanonicalStudentTRepresentation :=
ParseStudentTModel
→ ResolveRandomVariableOrStatistic
→ ResolveDegreesOfFreedom
→ ResolveLocationScale
→ ValidateParameters
→ ConstructPDF
→ ConstructCDF
→ ResolveMomentExistence
→ ResolveNormalChiSquaredConstruction
→ ResolveInferenceContext
→ ValidateStudentTDistribution
StudentTDistributionGraph :=
G=(V,E)
V := {
StudentTDistributions,
TRandomVariables,
DegreesOfFreedomNodes,
PDFs,
CDFs,
StandardNormals,
ChiSquaredDistributions,
SampleMeans,
SampleVariances,
TStatistics,
TTests,
ConfidenceIntervals,
FDistributions,
BayesianModels,
Evidence,
ProvenanceNodes
}
E := {
distributionOf,
hasDegreesOfFreedom,
hasSupport,
hasPDF,
hasCDF,
constructedFrom,
derivedFrom,
usedFor,
convergesTo,
squaredAs,
sampledFrom,
estimatedFrom,
constrainedBy,
equivalentTo,
tracesTo
}
CONFIDENCE(StudentTDistributionResolution) :=
weighted_mean(
RandomVariableOrStatisticResolution,
DegreesOfFreedomResolution,
LocationScaleResolution,
PDFConsistency,
MomentExistenceValidity,
SamplingConstructionValidity,
InferentialAssumptionQuality,
ProvenanceQuality
)
AI_QUERY_INTERPRETATION :=
Query
→ DetectStudentTDistributionIntent
→ IdentifyRandomVariableOrTStatistic
→ ResolveDegreesOfFreedom
→ ResolveLocationScaleOrSampleInformation
→ IdentifyRequestedProbabilityCriticalValueOrInference
AI_REASONING_FLOW :=
Query
→ ParseStudentTProblem
→ ResolveProbabilitySpace
→ ResolveTRandomVariableOrStatistic
→ ResolveDegreesOfFreedom
→ ValidateDegreesOfFreedom
→ ConstructStudentTPDF
→ ConstructOrEvaluateTCDF
→ ComputeTailProbabilityOrCriticalValueIfRequired
→ ValidateMomentExistenceIfRequired
→ ResolveNormalChiSquaredConstruction
→ ResolveOneSampleTwoSamplePairedOrRegressionContextIfRelevant
→ ResolveFDistributionRelationIfRelevant
→ ValidateStudentTModelAndInferenceAssumptions
→ UpdateConfidence
→ PreserveProvenance
→ GenerateExplanation
AI_CONSUMPTION := {
ParseStudentTDistributionEntities,
ParseTypedRelations,
ResolveTRandomVariables,
ResolveDegreesOfFreedom,
EvaluateStudentTPDFs,
EvaluateStudentTCDFs,
ComputeTailProbabilities,
ComputeCriticalValues,
ComputeConfidenceIntervals,
EvaluateTStatistics,
ResolveOneSampleTTests,
ResolveTwoSampleTTests,
ResolveWelchTTests,
ResolvePairedTTests,
ResolveRegressionTStatistics,
ResolveCorrelationTStatistics,
ResolveNormalChiSquaredConstruction,
ResolveFDistributionRelations,
ResolveBayesianStudentTModels,
ValidateStudentTDistributions,
CompareSemanticEquivalence,
UpdateConfidence,
PreserveProvenance,
GenerateFormalExplanation
}
UPDATE_MODEL :=
NewDataDegreesOfFreedomStatisticOrConstraint
→ ValidateInput
→ IdentifyAffectedStudentTClaims
→ UpdateStudentTState
→ RecomputePDF
→ RecomputeCDF
→ RecomputeCriticalValues
→ ReevaluateMomentExistence
→ RevalidateInferenceRelations
→ RecomputeConfidence
→ PreserveProvenance
→ VersionModel
DegreesOfFreedomUpdate :=
ChangedDegreesOfFreedom
⇒ revalidate(ν>0)
→ recompute(
PDF,
CDF,
VarianceWhereDefined,
TailProbabilities,
CriticalValues
)
SampleUpdate :=
NewOrChangedSampleData
⇒ recompute(
SampleMean,
SampleVariance,
TStatistic,
DegreesOfFreedom,
ConfidenceIntervalOrPValue
)
ModelUpdate :=
ChangedSamplingOrRegressionAssumptions
⇒ reevaluate(
ExactTDistributionValidity,
InferentialConfidence
)
FLOW_HASH_INPUT :=
canonical(
ONTOLOGY,
CoreClasses,
CoreRelations,
InferenceRules,
StudentsTDistribution,
TConstruction,
OneSampleTDistribution,
StudentTValidation,
SEMANTIC_EQUIVALENCE,
AI_REASONING_FLOW
)
FLOW_HASH :=
HASH(FLOW_HASH_INPUT)
OUTPUT_MODEL := {
StudentTDistributionEntityResolution,
ProbabilitySpace,
TRandomVariableOrStatistic,
DegreesOfFreedom,
Location,
Scale,
Support,
PDF,
CDF,
TailProbability,
CriticalValue,
MomentExistence,
SamplingConstruction,
InferenceContext,
ConfidenceIntervalOrTestRelation,
ValidationStatus,
Confidence,
Provenance,
Explanation
}
END_FLOW
END OF FULL EXECUTABLE FLOW ALGEBRA
Download Code
Copy to Clipboard