---
title: "mlab-builtins-stats-ttests — Mova code model"
description: "Mova code model of mlab/src/builtins/stats.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/stats.rs.groupant/ttests.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/stats.rs.groupant/ttests.groupant/>

# mlab-builtins-stats-ttests

The groupant beside mlab/src/builtins/stats.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`mlab/src/builtins/stats.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/builtins/stats.rs)
- **source SHA-256:** `bdc3772b09d9113e…`
- **covers:** test_opts checks Alpha before Tail; t_one removes NaNs, computes unbiased SD and SE, t=(mean-m0)/SE. t_two uses pooled or Welch variance. t_p guards NaN/nonpositive df then uses survival tail. Wrappers extract arguments first; ttest rejects incompatible paired lengths before options. Both wrappers parse options before checking the minimum cleaned sample count; verdict uses strict p<alpha. (bytes 15577–25404)
- **part of:** [mlab-builtins-stats](https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/stats.rs.groupant/)
- **repository folder:** [`mlab/src/builtins/stats.rs.groupant/ttests.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/builtins/stats.rs.groupant/ttests.groupant)
- **repository commit:** `855da7bd4a7b`

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | partial bounded parent evidence | [tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `tail_duality` | tail_duality | partial source derived model | [tail_duality](#tail-duality) |
| `confidence_interval` | confidence_interval | partial source derived model | [confidence_interval](#confidence-interval) |
| `branch_relation` | branch_relation | partial source derived model | [branch_relation](#branch-relation) |
| `resource_cost` | resource_cost | partial source derived model | [resource_cost](#resource-cost) |

## Model text


### descriptant

#### mlab-builtins-stats-ttests

test_opts checks Alpha before Tail; t_one removes NaNs, computes unbiased SD and SE, t=(mean-m0)/SE. t_two uses pooled or Welch variance. t_p guards NaN/nonpositive df then uses survival tail. Wrappers extract arguments first; ttest rejects incompatible paired lengths before options. Both wrappers parse options before checking the minimum cleaned sample count; verdict uses strict p<alpha.

Epoch 2026-10-31: isolated source-bound fragment over bytes [15577,25404); includes no claim beyond this relation. Source hash bdc3772b09d9113e108afa29e391fee97a5372caf9052bb1689996c41c94116f.

### approximant

#### ttests: forward relation

test_opts checks Alpha before Tail; t_one removes NaNs, computes unbiased SD and SE, t=(mean-m0)/SE. t_two uses pooled or Welch variance. t_p guards NaN/nonpositive df then uses survival tail. Wrappers extract arguments first; ttest rejects incompatible paired lengths before options. Both wrappers parse options before checking the minimum cleaned sample count; verdict uses strict p<alpha.

Domain: Finite, well-shaped bounded observations unless branch explicitly describes NaN/Inf. Direct public chi2/OLS helpers assume dimensions not checked at every index; wrappers add validation.

Executable surrogate gap: no measured cheaper implementation with a useful scoped metric is supplied. Categorical/error/effect relations are exact obligations, not percent losses. Future numeric caps only1/2/5/10%.

### invariant

#### ttests: invariant and cost

Left(t)=Right(-t), Both=2SF(abs(t)) capped1; fault substitutes Normal only.

Both CI uses tcrit(1-alpha/2); one-sided CI has one infinite endpoint. Reports do not validate independence/normality.

Scope-specific cost: T cores O(n+m) time and cleaned copies, option scan O(number of pairs), constant-size result and optional report.

### models

### behavior_complement

NaN p does not reject H0; printed nonreject text is not proof p>=alpha. Both-tail symmetric p cannot reveal t sign. Invalid option precedes insufficient-sample error.

### reverse_reconstruction

Given t,df,p, compatible samples include all location/scale transforms preserving standardized effect; t alone loses raw observations. Paired differences admit common offsets to x,y.

### tail_duality

Left(t)=Right(-t), Both=2SF(abs(t)) capped1; fault substitutes Normal only.

### confidence_interval

Both CI uses tcrit(1-alpha/2); one-sided CI has one infinite endpoint. Reports do not validate independence/normality.

### branch_relation

test_opts checks Alpha before Tail; t_one removes NaNs, computes unbiased SD and SE, t=(mean-m0)/SE. t_two uses pooled or Welch variance. t_p guards NaN/nonpositive df then uses survival tail. Wrappers extract arguments first; ttest rejects incompatible paired lengths before options. Both wrappers parse options before checking the minimum cleaned sample count; verdict uses strict p<alpha.

### resource_cost

T cores O(n+m) time and cleaned copies, option scan O(number of pairs), constant-size result and optional report.

### tests

#### Evidence boundary

See ../tests.md for the actual selected source test and mutant. These tests sample the file, not every fragment branch. NaN p does not reject H0; printed nonreject text is not proof p>=alpha. Both-tail symmetric p cannot reveal t sign. Invalid option precedes insufficient-sample error. Other branches here are source-derived and unexecuted unless the parent test explicitly calls them.
