moon-reliability

A practical MoonBit reliability engineering library with lifetime distributions, censored survival analysis, MLE fitting, accelerated life testing, system reliability, uncertainty analysis, and reproducible benchmarks.

reliability
statistics
math
weibull
lognormal
exponential
moon add wcx789ll/moon-reliability@0.2.0
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
5 hours ago
Downloads
1
README

#moon-reliability

MoonBit 可靠性工程与寿命数据分析库,面向硬件寿命试验、SaaS 可用性分析、质量控制和维护策略评估。库内算法使用 MoonBit 从零实现,包含可复现的本地基准和边界测试。

#能力概览

  • 寿命分布:Exponential、Weibull、Lognormal、Normal、Gamma、Gompertz、Log-logistic、Pareto、Inverse Gaussian,以及浴盆型组合模型。
  • 可靠性指标:PDF、CDF、可靠度、失效率、累积风险、MTTF/MTBF、分位数寿命和条件剩余寿命。
  • 生存数据:右删失、左删失、区间删失、Kaplan–Meier、Nelson–Aalen、生命表和竞争风险。
  • 参数估计:指数、Weibull、Lognormal 的删失数据 MLE,观测权重、置信区间、AIC/BIC 和模型诊断。
  • 工程分析:Arrhenius、逆幂律、Eyring 加速模型,串并联系统、网络可靠性、马尔可夫状态、保修、预防性维护、SLA 和安全分析。
  • 数据与决策:Bootstrap/Jackknife/Delta 不确定性、随机模拟、FMEA、故障树、控制图、敏感性分析、试验设计和可靠性增长。

#快速开始

moon.mod.json 或依赖配置中加入:

import {
"wcx789ll/moon-reliability" @reliability,
}

计算 Weibull 可靠度和 B10 寿命:

let model = @reliability.Weibull::new(100.0, 2.0)
let r50 = model.reliability(50.0)
let b10 = model.quantile(0.1)

使用删失样本进行 Kaplan–Meier 和 Weibull 拟合:

let records = [
@reliability.LifetimeRecord::observed(12.0),
@reliability.LifetimeRecord::observed(19.0),
@reliability.LifetimeRecord::right_censored(25.0),
]
let curve = @reliability.kaplan_meier(records)
let fit = @reliability.fit_weibull_censored(records)

#基准与复现

基准程序位于 cmd/benchmark,使用 2,000 条确定性生成的寿命记录、256 个分布网格点和系统可靠性计算。运行:

moon run --target native cmd/benchmark

一次已保存的本机结果见 BENCHMARK.md,其中包括输入规模、校验和、运行环境记录方式及 5 次实测耗时。校验和用于防止只测速度而遗漏计算结果;耗时会随 CPU、操作系统和 MoonBit 工具链变化。

#本地验证

moon fmt --check moon check --target all --deny-warn moon test --target all --deny-warn moon info moon run --target native cmd/benchmark

CI 在 Linux、macOS、Windows 上执行格式检查、全目标检查、全目标测试、API 信息一致性检查和 native 基准冒烟运行,并显式安装 Node.js 以覆盖 JavaScript 目标。

#项目结构

路径内容
*_distribution.mbt概率分布、可靠度和分位数算法
*_censored.mbtkaplan_meier.mbt删失数据、生存曲线和参数估计
system_reliability.mbtnetwork_reliability.mbt系统、网络和任务可靠性
simulation.mbtbootstrap.mbtuncertainty.mbt仿真和不确定性传播
observability.mbt运行时指标、事故、告警、预算和健康度
maintenance.mbtwarranty.mbtsla_analysis.mbt运维、保修和服务等级分析
cmd/benchmark可复现的 native 基准入口
.github/workflows跨平台 CI 与手动发布工作流

#原创与许可证

本项目为面向 MoonBit 生态的原创实现,使用公开的可靠性工程和数值分析算法,不包含第三方项目源码或测试数据的直接复制。项目以 Apache-2.0 协议发布,详见 LICENSE

#
AcceleratedLifeModel

pub struct AcceleratedLifeModel {
law : String
coefficients : Array[Double]
reference_stress : Double
unit : String
fit : RegressionResult
}

Arrhenius accelerated-life model: log life = intercept + slope / T.

#
AcceleratedLifeModel::acceleration_factor

fn AcceleratedLifeModel::acceleration_factor(self : AcceleratedLifeModel, use_stress : Double) -> Double

#
AcceleratedLifeModel::confidence_band

fn AcceleratedLifeModel::confidence_band(self : AcceleratedLifeModel, stress : Double, confidence_level : Double) -> MetricEstimate

#
AcceleratedLifeModel::predict_life

fn AcceleratedLifeModel::predict_life(self : AcceleratedLifeModel, stress : Double) -> Double

#
AcceleratedLifeModel::predict_log_life

fn AcceleratedLifeModel::predict_log_life(self : AcceleratedLifeModel, stress : Double) -> Double

#
AlertDecision

pub struct AlertDecision {
rule_name : String
triggered : Bool
value : Double
threshold : Double
consecutive : Int
severity : Int
}

#
AlertRule

pub struct AlertRule {
name : String
threshold : Double
direction : Int
minimum_samples : Int
consecutive_windows : Int
}

#
AvailabilityPoint

pub struct AvailabilityPoint {
time : Double
availability : Double
unavailability : Double
expected_failures : Double
}

Two-state continuous-time Markov availability model.

#
BathtubHazard

pub struct BathtubHazard {
early_rate : Double
random_rate : Double
wearout_scale : Double
wearout_shape : Double
}

Piecewise bathtub-hazard model for early, random and wear-out failures.

#
BathtubHazard::cdf

fn BathtubHazard::cdf(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::cumulative_hazard

fn BathtubHazard::cumulative_hazard(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::early_component

fn BathtubHazard::early_component(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::hazard

fn BathtubHazard::hazard(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::mean

fn BathtubHazard::mean(self : BathtubHazard) -> Double

#
BathtubHazard::pdf

fn BathtubHazard::pdf(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::phase

fn BathtubHazard::phase(self : BathtubHazard, time : Double) -> String

#
BathtubHazard::quantile

fn BathtubHazard::quantile(self : BathtubHazard, p : Double) -> Double

#
BathtubHazard::survival

fn BathtubHazard::survival(self : BathtubHazard, time : Double) -> Double

#
BathtubHazard::wearout_component

fn BathtubHazard::wearout_component(self : BathtubHazard, time : Double) -> Double

#
BenchmarkResult

pub struct BenchmarkResult {
name : String
iterations : Int
elapsed_micros : Int64
checksum : Double
operations_per_second : Double
}

A small result type used by deterministic benchmark helpers.

#
BootstrapResult

pub struct BootstrapResult {
estimates : Array[Double]
estimate : Double
bias : Double
standard_error : Double
lower : Double
upper : Double
confidence_level : Double
}

Bootstrap distribution and confidence interval.

#
CapacityPlan

pub struct CapacityPlan {
baseline : Double
peak : Double
headroom : Double
target : Double
required_capacity : Double
utilization : Double
breach : Bool
}

#
CompetingRiskCurve

pub struct CompetingRiskCurve {
points : Array[CumulativeIncidencePoint]
causes : Int
final_incidence : Array[Double]
}

#
CompetingRiskCurve::incidence_at

fn CompetingRiskCurve::incidence_at(self : CompetingRiskCurve, cause : Int, time : Double) -> Double

#
ConfidenceInterval

pub struct ConfidenceInterval {
lower : Double
upper : Double
}

Represents a confidence interval with lower and upper bounds.

#
ControlLimits

pub struct ControlLimits {
center : Double
upper : Double
lower : Double
sigma : Double
violations : Array[Int]
}

Control limits for reliability-monitoring streams.

#
CumulativeIncidencePoint

pub struct CumulativeIncidencePoint {
time : Double
at_risk : Int
events_by_cause : Array[Int]
survival : Double
incidence_by_cause : Array[Double]
}

One point of a cumulative-incidence curve.

#
DataQualityReport

pub struct DataQualityReport {
input_count : Int
valid_count : Int
invalid_count : Int
duplicate_count : Int
negative_count : Int
zero_count : Int
warnings : Array[String]
}

Data-cleaning report for reliability observations.

#
DesignPoint

pub struct DesignPoint {
id : Int
factors : Array[Double]
replicate : Int
center : Bool
}

A stress-test design point.

#
DiagnosticResult

pub struct DiagnosticResult {
statistic : Double
p_value : Double
passed : Bool
residuals : Array[Double]
message : String
}

Probability-integral-transform diagnostic for a fitted model.

#
EmpiricalDistribution

pub struct EmpiricalDistribution {
sorted_times : Array[Double]
failure_counts : Array[Int]
cumulative_failures : Array[Int]
total : Int
}

Empirical distribution function with deterministic tie handling.

#
EmpiricalDistribution::cdf

fn EmpiricalDistribution::cdf(self : EmpiricalDistribution, time : Double) -> Double

#
EmpiricalDistribution::probability_mass

fn EmpiricalDistribution::probability_mass(self : EmpiricalDistribution) -> Array[Double]

#
EmpiricalDistribution::quantile

fn EmpiricalDistribution::quantile(self : EmpiricalDistribution, p : Double) -> Double

#
EmpiricalDistribution::support

fn EmpiricalDistribution::support(self : EmpiricalDistribution) -> Array[Double]

#
EmpiricalDistribution::survival

fn EmpiricalDistribution::survival(self : EmpiricalDistribution, time : Double) -> Double

#
Exponential

pub struct Exponential {
lambda : Double
}

Exponential distribution for reliability and lifetime analysis. The parameter lambda is the failure rate (inverse of scale/MTBF).

#
Exponential::cdf

fn Exponential::cdf(self : Exponential, t : Double) -> Double

Cumulative distribution function (CDF) at time t (probability of failure before t).

#
Exponential::failure_rate

fn Exponential::failure_rate(self : Exponential, _t : Double) -> Double

Failure rate function (Hazard rate), constant for Exponential.

#
Exponential::mtbf

fn Exponential::mtbf(self : Exponential) -> Double

Mean Time Between Failures (MTBF).

#
Exponential::new

fn Exponential::new(lambda : Double) -> Exponential

Create a new Exponential distribution. Panics if lambda is not strictly positive.

#
Exponential::pdf

fn Exponential::pdf(self : Exponential, t : Double) -> Double

Probability density function (PDF) at time t.

#
Exponential::quantile

fn Exponential::quantile(self : Exponential, p : Double) -> Double

Quantile function (inverse CDF). Returns the time at which cumulative probability is p.

#
Exponential::reliability

fn Exponential::reliability(self : Exponential, t : Double) -> Double

Reliability function R(t) = 1 - CDF(t), probability of surviving past time t.

#
FailureModeContribution

pub struct FailureModeContribution {
name : String
probability : Double
cost : Double
risk_contribution : Double
}

#
FaultTreeResult

pub struct FaultTreeResult {
top_event_probability : Double
minimal_cut_sets : Array[Array[Int]]
dominant_component : Int?
}

#
FitResult

pub struct FitResult {
distribution : String
parameters : Array[Double]
log_likelihood : Double
aic : Double
bic : Double
iterations : Int
converged : Bool
standard_errors : Array[Double]
}

Result of a distribution fit.

#
FleetPlan

pub struct FleetPlan {
fleet_size : Int
horizon : Double
expected_failures : Double
spare_units : Int
stockout_probability : Double
expected_downtime : Double
}

Fleet-level planning metrics for engineering and SaaS operations.

#
ForecastPoint

pub struct ForecastPoint {
horizon : Int
value : Double
lower : Double
upper : Double
}

#
ForecastResult

pub struct ForecastResult {
points : Array[TimeSeriesPoint]
algorithm : String
residual_scale : Double
}

#
ForecastSeries

pub struct ForecastSeries {
points : Array[ForecastPoint]
slope : Double
intercept : Double
residual_scale : Double
}

#
GammaDistribution

pub struct GammaDistribution {
shape : Double
rate : Double
}

Gamma lifetime distribution parameterized by shape and rate.

#
GammaDistribution::cdf

fn GammaDistribution::cdf(self : GammaDistribution, x : Double) -> Double

#
GammaDistribution::failure_rate

fn GammaDistribution::failure_rate(self : GammaDistribution, x : Double) -> Double

#
GammaDistribution::log_pdf

fn GammaDistribution::log_pdf(self : GammaDistribution, x : Double) -> Double

#
GammaDistribution::mean

fn GammaDistribution::mean(self : GammaDistribution) -> Double

#
GammaDistribution::new

fn GammaDistribution::new(shape : Double, rate : Double) -> GammaDistribution

#
GammaDistribution::pdf

fn GammaDistribution::pdf(self : GammaDistribution, x : Double) -> Double

#
GammaDistribution::quantile

fn GammaDistribution::quantile(self : GammaDistribution, p : Double) -> Double

#
GammaDistribution::reliability

fn GammaDistribution::reliability(self : GammaDistribution, x : Double) -> Double

#
GammaDistribution::variance

fn GammaDistribution::variance(self : GammaDistribution) -> Double

#
Gompertz

pub struct Gompertz {
scale : Double
growth : Double
}

Gompertz distribution for ageing populations and wear-out dominated assets.

#
Gompertz::cdf

fn Gompertz::cdf(self : Gompertz, t : Double) -> Double

#
Gompertz::cum_hazard

fn Gompertz::cum_hazard(self : Gompertz, t : Double) -> Double

#
Gompertz::hazard

fn Gompertz::hazard(self : Gompertz, t : Double) -> Double

#
Gompertz::mean

fn Gompertz::mean(self : Gompertz) -> Double

#
Gompertz::new

fn Gompertz::new(scale : Double, growth : Double) -> Gompertz

#
Gompertz::pdf

fn Gompertz::pdf(self : Gompertz, t : Double) -> Double

#
Gompertz::quantile

fn Gompertz::quantile(self : Gompertz, p : Double) -> Double

#
Gompertz::reliability

fn Gompertz::reliability(self : Gompertz, t : Double) -> Double

#
HealthSnapshot

pub struct HealthSnapshot {
availability : Double
stability : Double
coverage : Double
freshness : Double
health_score : Double
status : String
}

#
IncidentRecord

pub struct IncidentRecord {
start : Double
end : Double
severity : Int
cause : Int
}

#
IncidentSummary

pub struct IncidentSummary {
count : Int
total_duration : Double
union_duration : Double
mean_duration : Double
maximum_duration : Double
severity_weight : Double
rate : Double
}

#
IntervalRecord

pub struct IntervalRecord {
lower : Double
upper : Double
status : ObservationStatus
weight : Double
}

A record that retains both endpoints of an inspection interval.

#
InverseGaussian

pub struct InverseGaussian {
mean : Double
shape : Double
}

Inverse-Gaussian lifetime distribution for degradation and first-passage models.

#
InverseGaussian::cdf

fn InverseGaussian::cdf(self : InverseGaussian, time : Double) -> Double

#
InverseGaussian::hazard

fn InverseGaussian::hazard(self : InverseGaussian, time : Double) -> Double

#
InverseGaussian::mean

fn InverseGaussian::mean(self : InverseGaussian) -> Double

#
InverseGaussian::new

fn InverseGaussian::new(mean : Double, shape : Double) -> InverseGaussian

#
InverseGaussian::pdf

fn InverseGaussian::pdf(self : InverseGaussian, time : Double) -> Double

#
InverseGaussian::quantile

fn InverseGaussian::quantile(self : InverseGaussian, p : Double) -> Double

#
InverseGaussian::survival

fn InverseGaussian::survival(self : InverseGaussian, time : Double) -> Double

#
InverseGaussian::variance

fn InverseGaussian::variance(self : InverseGaussian) -> Double

#
LifeObservation

pub struct LifeObservation {
time : Double
status : ObservationStatus
cause : Int
weight : Double
}

A single lifetime record. time is measured in the caller's unit.

#
LifeObservation::is_censored

fn LifeObservation::is_censored(self : LifeObservation) -> Bool

#
LifeObservation::is_failure

fn LifeObservation::is_failure(self : LifeObservation) -> Bool

#
LifeObservation::with_metadata

fn LifeObservation::with_metadata(self : LifeObservation, cause~ : Int, weight~ : Double) -> LifeObservation

Attach a failure cause and sampling weight to an observation.

#
LifeTable

pub struct LifeTable {
intervals : Array[LifeTableInterval]
total_failures : Int
restricted_mean : Double
final_survival : Double
}

#
LifeTable::hazard_at

fn LifeTable::hazard_at(self : LifeTable, time : Double) -> Double

#
LifeTable::intervals

fn LifeTable::intervals(self : LifeTable) -> Array[LifeTableInterval]

#
LifeTable::survival_at

fn LifeTable::survival_at(self : LifeTable, time : Double) -> Double

#
LifeTableInterval

pub struct LifeTableInterval {
lower : Double
upper : Double
exposed : Double
failures : Int
withdrawals : Int
failure_probability : Double
survival_probability : Double
hazard : Double
}

Actuarial life-table interval.

#
LogLogistic

pub struct LogLogistic {
scale : Double
shape : Double
}

Log-logistic distribution, useful for bathtub-shaped hazard curves.

#
LogLogistic::cdf

fn LogLogistic::cdf(self : LogLogistic, t : Double) -> Double

#
LogLogistic::hazard

fn LogLogistic::hazard(self : LogLogistic, t : Double) -> Double

#
LogLogistic::mean

fn LogLogistic::mean(self : LogLogistic) -> Double

#
LogLogistic::new

fn LogLogistic::new(scale : Double, shape : Double) -> LogLogistic

#
LogLogistic::pdf

fn LogLogistic::pdf(self : LogLogistic, t : Double) -> Double

#
LogLogistic::quantile

fn LogLogistic::quantile(self : LogLogistic, p : Double) -> Double

#
LogLogistic::reliability

fn LogLogistic::reliability(self : LogLogistic, t : Double) -> Double

#
LogLogistic::variance

fn LogLogistic::variance(self : LogLogistic) -> Double

#
Lognormal

pub struct Lognormal {
mu : Double
sigma : Double
}

Lognormal distribution for reliability modeling. The parameters mu and sigma are the mean and standard deviation of the variable's natural logarithm.

#
Lognormal::cdf

fn Lognormal::cdf(self : Lognormal, t : Double) -> Double

Cumulative distribution function (CDF) at time t.

#
Lognormal::mtbf

fn Lognormal::mtbf(self : Lognormal) -> Double

Mean Time Between Failures (MTBF).

#
Lognormal::new

fn Lognormal::new(mu : Double, sigma : Double) -> Lognormal

Create a new Lognormal distribution. Panics if sigma is not strictly positive.

#
Lognormal::pdf

fn Lognormal::pdf(self : Lognormal, t : Double) -> Double

Probability density function (PDF) at time t.

#
Lognormal::quantile

fn Lognormal::quantile(self : Lognormal, p : Double) -> Double

Quantile function (inverse CDF).

#
Lognormal::reliability

fn Lognormal::reliability(self : Lognormal, t : Double) -> Double

Reliability function R(t) = 1 - CDF(t).

#
MaintenanceAction

pub(all) enum MaintenanceAction {
Inspect
PreventiveReplace
CorrectiveRepair
NoAction
} derive(Eq,
Debug
)

Maintenance policy for preventive and corrective actions.

#
MaintenanceSchedule

pub struct MaintenanceSchedule {
ages : Array[Double]
actions : Array[MaintenanceAction]
expected_costs : Array[Double]
expected_availability : Array[Double]
selected_age : Double
}

#
MetricEstimate

pub struct MetricEstimate {
estimate : Double
lower : Double
upper : Double
confidence_level : Double
}

A point estimate and confidence interval for a reliability metric.

#
MissionResult

pub struct MissionResult {
survival : Double
cumulative_hazard : Double
segment_hazards : Array[Double]
expected_failures : Double
}

#
MissionSegment

pub struct MissionSegment {
start : Double
duration : Double
stress_multiplier : Double
}

Mission profile with multiple operating segments.

#
ModelComparison

pub struct ModelComparison {
names : Array[String]
log_likelihoods : Array[Double]
aic : Array[Double]
bic : Array[Double]
preferred_aic : Int
preferred_bic : Int
}

Information-criterion comparison for fitted reliability models.

#
NetworkReliability

pub struct NetworkReliability {
component_count : Int
paths : Array[Array[Int]]
reliability : Double
path_contributions : Array[Double]
}

A small path-set network model. Paths use zero-based component indexes.

#
Normal

pub struct Normal {
mean : Double
standard_deviation : Double
}

Standard and non-standard Gaussian lifetime model.

#
Normal::cdf

fn Normal::cdf(self : Normal, x : Double) -> Double

#
Normal::entropy

fn Normal::entropy(self : Normal) -> Double

#
Normal::hazard

fn Normal::hazard(self : Normal, x : Double) -> Double

#
Normal::log_pdf

fn Normal::log_pdf(self : Normal, x : Double) -> Double

#
Normal::new

fn Normal::new(mean : Double, standard_deviation : Double) -> Normal

#
Normal::pdf

fn Normal::pdf(self : Normal, x : Double) -> Double

#
Normal::quantile

fn Normal::quantile(self : Normal, p : Double) -> Double

#
Normal::reliability

fn Normal::reliability(self : Normal, x : Double) -> Double

#
Normal::standardize

fn Normal::standardize(self : Normal, x : Double) -> Double

#
Normal::variance

fn Normal::variance(self : Normal) -> Double

#
ObservationStatus

pub(all) enum ObservationStatus {
Failed
RightCensored
LeftCensored
IntervalCensored
} derive(Eq,
Debug
)

The observation status used by survival and reliability estimators.

#
OptimizationResult

pub struct OptimizationResult {
parameter : Double
objective : Double
iterations : Int
converged : Bool
}

Bounded one-dimensional optimization utilities for life-model calibration.

#
OutageMetrics

pub struct OutageMetrics {
saidi : Double
saifi : Double
caidi : Double
asai : Double
maifi : Double
total_customer_interruptions : Int
}

#
OutageRecord

pub struct OutageRecord {
customer : Int
start : Double
duration : Double
customers_affected : Int
cause : Int
}

Customer outage record used for utility-style reliability metrics.

#
Pareto

pub struct Pareto {
scale : Double
shape : Double
}

Pareto type-I tail model for heavy-tailed lifetime and incident data.

#
Pareto::cdf

fn Pareto::cdf(self : Pareto, time : Double) -> Double

#
Pareto::conditional_mean

fn Pareto::conditional_mean(self : Pareto, age : Double) -> Double

#
Pareto::hazard

fn Pareto::hazard(self : Pareto, time : Double) -> Double

#
Pareto::mean

fn Pareto::mean(self : Pareto) -> Double

#
Pareto::new

fn Pareto::new(scale : Double, shape : Double) -> Pareto

#
Pareto::pdf

fn Pareto::pdf(self : Pareto, time : Double) -> Double

#
Pareto::quantile

fn Pareto::quantile(self : Pareto, p : Double) -> Double

#
Pareto::survival

fn Pareto::survival(self : Pareto, time : Double) -> Double

#
Pareto::variance

fn Pareto::variance(self : Pareto) -> Double

#
PolicyAction

pub(all) enum PolicyAction {
ContinueMonitoring
InspectSoon
ScheduleMaintenance
RemoveFromService
} derive(Eq,
Debug
)

Operational policy for selecting an action from a reliability signal.

#
PolicyDecision

pub struct PolicyDecision {
action : PolicyAction
score : Double
reason : String
urgency_hours : Double
}

#
RandomState

pub struct RandomState {
state : Int
}

Small deterministic pseudo-random generator for reproducible reliability experiments. It is not intended for cryptography.

#
RandomState::exponential

fn RandomState::exponential(self : RandomState, lambda : Double) -> Double

#
RandomState::lognormal

fn RandomState::lognormal(self : RandomState, mu : Double, sigma : Double) -> Double

#
RandomState::new

fn RandomState::new(seed : Int) -> RandomState

#
RandomState::next_int

fn RandomState::next_int(self : RandomState) -> Int

#
RandomState::normal

fn RandomState::normal(self : RandomState) -> Double

#
RandomState::uniform

fn RandomState::uniform(self : RandomState) -> Double

#
RandomState::weibull

fn RandomState::weibull(self : RandomState, scale : Double, shape : Double) -> Double

#
RegressionResult

pub struct RegressionResult {
coefficients : Array[Double]
standard_errors : Array[Double]
fitted : Array[Double]
residuals : Array[Double]
r_squared : Double
adjusted_r_squared : Double
residual_sum_squares : Double
observations : Int
}

Ordinary and weighted least-squares result for engineering covariates.

#
ReliabilityBudget

pub struct ReliabilityBudget {
target : Double
observed : Double
remaining : Double
burn_rate : Double
consumed_fraction : Double
status : String
}

#
ReliabilityGrowthModel

pub struct ReliabilityGrowthModel {
intercept : Double
shape : Double
scale : Double
fit : RegressionResult
}

Crow-AMSAA / Duane reliability-growth model.

#
ReliabilityGrowthModel::expected_failures

fn ReliabilityGrowthModel::expected_failures(self : ReliabilityGrowthModel, time : Double) -> Double

#
ReliabilityGrowthModel::failure_intensity

fn ReliabilityGrowthModel::failure_intensity(self : ReliabilityGrowthModel, time : Double) -> Double

#
ReliabilityGrowthModel::improvement_factor

fn ReliabilityGrowthModel::improvement_factor(self : ReliabilityGrowthModel, start : Double, end : Double) -> Double

#
ReliabilityGrowthModel::mtbf

fn ReliabilityGrowthModel::mtbf(self : ReliabilityGrowthModel, time : Double) -> Double

#
ReliabilityGrowthModel::predict_time_for_failures

fn ReliabilityGrowthModel::predict_time_for_failures(self : ReliabilityGrowthModel, failures : Double) -> Double

#
ReliabilityGrowthModel::reliability_growth_confidence

fn ReliabilityGrowthModel::reliability_growth_confidence(self : ReliabilityGrowthModel, time : Double, confidence : Double) -> MetricEstimate

#
ReliabilityModel

pub(all) enum ReliabilityModel {
ExponentialModel(Exponential)
WeibullModel(Weibull)
LognormalModel(Lognormal)
GammaModel(GammaDistribution)
LogLogisticModel(LogLogistic)
}

A common model interface for censored likelihood calculations.

#
ReliabilityModel::cdf

fn ReliabilityModel::cdf(self : ReliabilityModel, time : Double) -> Double

#
ReliabilityModel::log_likelihood

fn ReliabilityModel::log_likelihood(self : ReliabilityModel, records : Array[LifeObservation]) -> Double

#
ReliabilityModel::pdf

fn ReliabilityModel::pdf(self : ReliabilityModel, time : Double) -> Double

#
ReliabilityModel::survival

fn ReliabilityModel::survival(self : ReliabilityModel, time : Double) -> Double

#
ReliabilityRequirement

pub struct ReliabilityRequirement {
name : String
mission_time : Double
minimum_survival : Double
confidence_level : Double
penalty : Double
}

Contractual reliability requirement over a set of mission checkpoints.

#
ReliabilityScorecard

pub struct ReliabilityScorecard {
reliability_score : Double
availability_score : Double
quality_score : Double
maintenance_score : Double
overall_score : Double
grade : String
recommendations : Array[String]
}

Operational health score assembled from reliability indicators.

#
ReliabilitySnapshot

pub struct ReliabilitySnapshot {
time : Double
reliability : Double
hazard : Double
cumulative_hazard : Double
mission_success : Double
}

#
ReliabilitySystem

pub struct ReliabilitySystem {
name : String
logic : SystemLogic
component_reliabilities : Array[Double]
reliability : Double
importance : Array[Double]
}

#
RequirementResult

pub struct RequirementResult {
requirement : String
estimate : Double
lower_bound : Double
margin : Double
passed : Bool
penalty : Double
explanation : String
}

#
RiskItem

pub struct RiskItem {
name : String
severity : Int
occurrence : Int
detection : Int
risk_priority_number : Int
recommended_action : String
}

Failure-mode-and-effects-analysis item.

#
SampleSummary

pub struct SampleSummary {
count : Int
failures : Int
censored : Int
total_weight : Double
mean : Double
variance : Double
standard_deviation : Double
minimum : Double
maximum : Double
median : Double
}

Summary statistics returned by summarize.

#
SensitivityPoint

pub struct SensitivityPoint {
parameter : String
baseline : Double
perturbed : Double
absolute_change : Double
relative_change : Double
elasticity : Double
}

Local sensitivity result for a reliability metric.

#
SlaPolicy

pub struct SlaPolicy {
window : Double
promised_availability : Double
credit_rate : Double
maximum_credit : Double
}

Service-level agreement availability policy.

#
SlaResult

pub struct SlaResult {
observed_availability : Double
downtime : Double
breach : Bool
credit : Double
error_budget_remaining : Double
confidence : MetricEstimate
}

#
SurvivalCurve

pub struct SurvivalCurve {
points : Array[SurvivalPoint]
median : Double?
restricted_mean : Double
total_events : Int
}

Non-parametric survival curve and its summary metrics.

#
SurvivalCurve::hazard_at

fn SurvivalCurve::hazard_at(self : SurvivalCurve, time : Double) -> Double

#
SurvivalCurve::median_life

fn SurvivalCurve::median_life(self : SurvivalCurve) -> Double?

#
SurvivalCurve::points

#
SurvivalCurve::survival_at

fn SurvivalCurve::survival_at(self : SurvivalCurve, time : Double) -> Double

#
SurvivalPoint

pub struct SurvivalPoint {
time : Double
at_risk : Int
events : Int
censored : Int
survival : Double
standard_error : Double
cumulative_hazard : Double
}

One step of a non-parametric survival curve.

#
SystemLogic

pub(all) enum SystemLogic {
Series
Parallel
KOutOfN(Int)
}

Series, parallel and k-out-of-n block reliability calculations.

#
SystemLogic::evaluate

fn SystemLogic::evaluate(self : SystemLogic, components : Array[Double]) -> Double

#
TelemetryPoint

pub struct TelemetryPoint {
timestamp : Double
value : Double
healthy : Bool
weight : Double
}

Runtime observability primitives for services and production equipment. The module turns timestamped measurements and incidents into reliability indicators that can be used by dashboards, alerting, and planning code.

#
TelemetryWindow

pub struct TelemetryWindow {
points : Array[TelemetryPoint]
start : Double
end : Double
interval : Double
}

#
TimeSeriesPoint

pub struct TimeSeriesPoint {
time : Double
value : Double
lower : Double
upper : Double
}

Time-indexed reliability metric.

#
TransitionMatrix

pub struct TransitionMatrix {
states : Int
values : Array[Array[Double]]
}

Finite-state transition matrix for repairable systems.

#
TransitionMatrix::power

fn TransitionMatrix::power(self : TransitionMatrix, distribution : Array[Double], steps : Int) -> Array[Double]

#
TransitionMatrix::step

fn TransitionMatrix::step(self : TransitionMatrix, distribution : Array[Double]) -> Array[Double]

#
TruncatedModel

pub struct TruncatedModel {
base : ReliabilityModel
lower : Double
upper : Double
normalization : Double
}

Transform an ordinary lifetime model into a truncated model.

#
TruncatedModel::cdf

fn TruncatedModel::cdf(self : TruncatedModel, time : Double) -> Double

#
TruncatedModel::pdf

fn TruncatedModel::pdf(self : TruncatedModel, time : Double) -> Double

#
TruncatedModel::quantile

fn TruncatedModel::quantile(self : TruncatedModel, p : Double) -> Double

#
TruncatedModel::reliability

fn TruncatedModel::reliability(self : TruncatedModel, time : Double) -> Double

#
WarrantyAnalysis

pub struct WarrantyAnalysis {
claims : Double
expected_cost : Double
cost_per_unit_time : Double
claim_probability : Double
renewal_cycles : Double
}

#
WarrantyPolicy

pub struct WarrantyPolicy {
duration : Double
replacement_cost : Double
service_cost : Double
salvage_value : Double
renewal : Bool
}

Warranty policy and renewal-cost analysis.

#
Weibull

pub struct Weibull {
scale : Double
shape : Double
}

Weibull distribution for reliability modeling. The parameter scale () is the characteristic life. The parameter shape () is the shape parameter (slope).

#
Weibull::cdf

fn Weibull::cdf(self : Weibull, t : Double) -> Double

Cumulative distribution function (CDF) at time t.

#
Weibull::failure_rate

fn Weibull::failure_rate(self : Weibull, t : Double) -> Double

Failure rate function (Hazard rate) at time t.

#
Weibull::mtbf

fn Weibull::mtbf(self : Weibull) -> Double

Mean Time Between Failures (MTBF) / Expected Value.

#
Weibull::new

fn Weibull::new(scale : Double, shape : Double) -> Weibull

Create a new Weibull distribution. Panics if scale or shape are not strictly positive.

#
Weibull::pdf

fn Weibull::pdf(self : Weibull, t : Double) -> Double

Probability density function (PDF) at time t.

#
Weibull::quantile

fn Weibull::quantile(self : Weibull, p : Double) -> Double

Quantile function (inverse CDF). Returns the time at which cumulative probability is p.

#
Weibull::reliability

fn Weibull::reliability(self : Weibull, t : Double) -> Double

Reliability function R(t) = 1 - CDF(t), probability of surviving past time t.

#
accelerated_life_model

fn accelerated_life_model(law~ : String, coefficients~ : Array[Double], reference_stress~ : Double, unit~ : String, fit~ : RegressionResult) -> AcceleratedLifeModel

#
acceptance_number

fn acceptance_number(sample_size : Int, allowable_failure_rate : Double) -> Int

#
action_from_metric

fn action_from_metric(metric : MetricEstimate, target : Double) -> PolicyAction

#
actuarial_life_table

fn actuarial_life_table(records : Array[LifeObservation], grid : Array[Double]) -> LifeTable

Construct an actuarial life table over a regular grid. Withdrawals are treated as half-interval exposures, which is the standard engineering life-table approximation when inspection times are not exact.

#
add_vectors

fn add_vectors(left : Array[Double], right : Array[Double]) -> Array[Double]

#
age_replacement_schedule

fn age_replacement_schedule(model : ReliabilityModel, policy_cost : Double, repair_cost : Double, start_age : Double, end_age : Double, steps : Int) -> MaintenanceSchedule

#
aic

fn aic(log_likelihood : Double, parameter_count : Int) -> Double

#
akaike_weights

fn akaike_weights(comparison : ModelComparison) -> Array[Double]

#
alert_budget

fn alert_budget(score : Double, daily_budget : Int) -> Int

#
alert_rule

fn alert_rule(name~ : String, threshold~ : Double, direction~ : Int, minimum_samples~ : Int, consecutive_windows~ : Int) -> AlertRule

#
alert_rule_breached

fn alert_rule_breached(rule : AlertRule, value : Double, samples : Int) -> Bool

#
alert_severity

fn alert_severity(burn : Double) -> String

#
alert_severity_score

fn alert_severity_score(decision : AlertDecision) -> Double

#
alternating_renewal_availability

fn alternating_renewal_availability(uptime : Double, downtime : Double) -> Double

#
analyze_warranty

fn analyze_warranty(model : ReliabilityModel, policy : WarrantyPolicy) -> WarrantyAnalysis

#
arrhenius_acceleration

fn arrhenius_acceleration(activation_energy : Double, use_temperature : Double, reference_temperature : Double) -> Double

#
autocorrelation

fn autocorrelation(values : Array[Double], offset : Int) -> Double

#
autocorrelation_lag

fn autocorrelation_lag(values : Array[Double], lag : Int) -> Double

#
availability_from_incidents

fn availability_from_incidents(incident_durations : Array[Double], window : Double) -> Double

#
availability_point

fn availability_point(time~ : Double, availability~ : Double, unavailability~ : Double, expected_failures~ : Double) -> AvailabilityPoint

#
availability_slo_curve

fn availability_slo_curve(model : ReliabilityModel, windows : Array[Double]) -> Array[MetricEstimate]

#
bathtub_hazard

fn bathtub_hazard(early_rate~ : Double, random_rate~ : Double, wearout_scale~ : Double, wearout_shape~ : Double) -> BathtubHazard

#
benchmark_dataset

fn benchmark_dataset(size : Int) -> Array[LifeObservation]

#
benchmark_distribution_kernel

fn benchmark_distribution_kernel(model : ReliabilityModel, grid : Array[Double], repetitions : Int) -> Double

Deterministic kernels used by the benchmark CLI and regression tests.

#
benchmark_grid

fn benchmark_grid(size : Int) -> Array[Double]

#
benchmark_markdown

fn benchmark_markdown(results : Array[BenchmarkResult]) -> String

#
benchmark_result

fn benchmark_result(name~ : String, iterations~ : Int, elapsed_micros~ : Int64, checksum~ : Double, operations_per_second~ : Double) -> BenchmarkResult

#
benchmark_result_from_measurement

fn benchmark_result_from_measurement(name : String, iterations : Int, elapsed_micros : Int64, checksum : Double) -> BenchmarkResult

#
benchmark_statistics_kernel

fn benchmark_statistics_kernel(values : Array[Double], repetitions : Int) -> Double

#
benchmark_survival_kernel

fn benchmark_survival_kernel(records : Array[LifeObservation], repetitions : Int) -> Double

#
benchmark_system_kernel

fn benchmark_system_kernel(models : Array[ReliabilityModel], times : Array[Double], repetitions : Int) -> Double

#
bic

fn bic(log_likelihood : Double, parameter_count : Int, sample_size : Int) -> Double

#
bootstrap_mean

fn bootstrap_mean(values : Array[Double], replications : Int, seed : Int, confidence_level : Double) -> BootstrapResult

#
bootstrap_median

fn bootstrap_median(values : Array[Double], replications : Int, seed : Int, confidence_level : Double) -> BootstrapResult

#
bootstrap_reliability

fn bootstrap_reliability(records : Array[LifeObservation], time : Double, replications : Int, seed : Int) -> BootstrapResult

#
bootstrap_result

fn bootstrap_result(estimates~ : Array[Double], estimate~ : Double, bias~ : Double, standard_error~ : Double, lower~ : Double, upper~ : Double, confidence_level~ : Double) -> BootstrapResult

#
bootstrap_standard_error

fn bootstrap_standard_error(result : BootstrapResult) -> Double

#
bootstrap_statistic

fn bootstrap_statistic(values : Array[Double], replications : Int, seed : Int, confidence_level : Double, statistic : (Array[Double]) -> Double) -> BootstrapResult

#
bridge_component_reliability

fn bridge_component_reliability(left : Double, bridge : Double, right : Double) -> Double

#
budget_burn_rate

fn budget_burn_rate(budget : ReliabilityBudget) -> Double

#
budget_consumed

fn budget_consumed(budget : ReliabilityBudget) -> Double

#
budget_is_exhausted

fn budget_is_exhausted(budget : ReliabilityBudget) -> Bool

#
budget_projection

fn budget_projection(budget : ReliabilityBudget, future_windows : Int) -> Double

#
budget_recovery_needed

fn budget_recovery_needed(budget : ReliabilityBudget) -> Double

#
budget_remaining

fn budget_remaining(budget : ReliabilityBudget) -> Double

#
budget_status

fn budget_status(budget : ReliabilityBudget) -> String

#
build_reliability_system

fn build_reliability_system(name : String, logic : SystemLogic, components : Array[Double]) -> ReliabilitySystem

#
build_scorecard

fn build_scorecard(model : ReliabilityModel, observed_availability : Double, defect_rate_value : Double, maintenance_compliance : Double, horizon : Double) -> ReliabilityScorecard

#
burn_rate

fn burn_rate(observed : Double, target : Double, interval : Double) -> Double

#
calculate_outage_metrics

fn calculate_outage_metrics(outages : Array[OutageRecord], customers : Int, observation_window : Double) -> OutageMetrics

#
calibration_intercept

fn calibration_intercept(predicted : Array[Double], observed : Array[Double]) -> Double

#
calibration_slope

fn calibration_slope(predicted : Array[Double], observed : Array[Double]) -> Double

#
capability_indices

fn capability_indices(values : Array[Double], lower_spec : Double, upper_spec : Double) -> (Double, Double, Double)

#
capacity_breach

fn capacity_breach(plan : CapacityPlan) -> Bool

#
capacity_forecast

fn capacity_forecast(observations : Array[Double], horizon : Int, target_utilization : Double, safety_factor : Double) -> Array[Double]

#
capacity_headroom

fn capacity_headroom(plan : CapacityPlan) -> Double

#
capacity_plan

fn capacity_plan(observations : Array[Double], target_utilization : Double, safety_factor : Double) -> CapacityPlan

#
capacity_risk

fn capacity_risk(plan : CapacityPlan) -> Double

#
capacity_scale_factor

fn capacity_scale_factor(plan : CapacityPlan) -> Double

#
cause_specific_hazard

fn cause_specific_hazard(records : Array[LifeObservation], cause : Int) -> Array[MetricEstimate]

#
censored_log_likelihood

fn censored_log_likelihood(model : ReliabilityModel, records : Array[LifeObservation]) -> Double

#
central_composite_design

fn central_composite_design(factor_count : Int, axial_distance : Double) -> Array[DesignPoint]

#
central_moment

fn central_moment(values : Array[Double], order : Int) -> Double

#
change_direction

fn change_direction(value : Double) -> Int

#
change_directions

fn change_directions(values : Array[Double]) -> Array[Int]

#
change_magnitudes

fn change_magnitudes(values : Array[Double]) -> Array[Double]

#
change_points

fn change_points(values : Array[Double], threshold : Double) -> Array[Int]

#
choose

fn choose(n : Int, k : Int) -> Double

#
clamp_probability

fn clamp_probability(p : Double) -> Double

#
code_factor

fn code_factor(value : Double, lower : Double, upper : Double) -> Double

#
cold_standby_reliability

fn cold_standby_reliability(primary : ReliabilityModel, standby : ReliabilityModel, switch_probability : Double, time : Double) -> Double

#
combine_estimates

fn combine_estimates(estimates : Array[Double], standard_errors : Array[Double]) -> MetricEstimate

#
common_cause_adjustment

fn common_cause_adjustment(independent : Double, beta : Double) -> Double

#
compare_fits

fn compare_fits(fits : Array[FitResult]) -> ModelComparison

#
compensated_sum

fn compensated_sum(values : Array[Double]) -> Double

Sum values using a compensated Kahan accumulator.

#
competing_risk_curve

fn competing_risk_curve(points~ : Array[CumulativeIncidencePoint], causes~ : Int, final_incidence~ : Array[Double]) -> CompetingRiskCurve

#
component_importance

fn component_importance(logic : SystemLogic, components : Array[Double]) -> Array[Double]

#
conditional_exceedance_mean

fn conditional_exceedance_mean(values : Array[Double], threshold : Double) -> Double

#
confidence_interval

fn confidence_interval(estimate : Double, standard_error : Double, confidence_level : Double) -> ConfidenceInterval

Computes the confidence interval for a normally distributed estimate. estimate is the point estimate. standard_error is the standard error of the estimate. confidence_level is the desired confidence level (e.g., 0.95 for 95%).

#
confidence_to_standard_error

fn confidence_to_standard_error(lower : Double, upper : Double, confidence : Double) -> Double

#
contract_summary

fn contract_summary(results : Array[RequirementResult]) -> String

#
control_limits

fn control_limits(center~ : Double, upper~ : Double, lower~ : Double, sigma~ : Double, violations~ : Array[Int]) -> ControlLimits

#
coordinate_descent

fn coordinate_descent(initial : Array[Double], objective : (Array[Double]) -> Double, step : Double, iterations : Int) -> Array[Double]

#
correlation

fn correlation(left : Array[Double], right : Array[Double]) -> Double

#
covariance

fn covariance(left : Array[Double], right : Array[Double]) -> Double

#
cross_entropy

fn cross_entropy(model : ReliabilityModel, records : Array[LifeObservation]) -> Double

#
cumulative_exposure

fn cumulative_exposure(records : Array[LifeObservation], grid : Array[Double]) -> Array[Double]

#
cumulative_incidence

fn cumulative_incidence(records : Array[LifeObservation], causes : Int) -> CompetingRiskCurve

Cause values are stored in the observation's cause field; cause zero is treated as ordinary failure and causes start at one for competing events.

#
cumulative_incidence_point

fn cumulative_incidence_point(time~ : Double, at_risk~ : Int, events_by_cause~ : Array[Int], survival~ : Double, incidence_by_cause~ : Array[Double]) -> CumulativeIncidencePoint

#
cusum

fn cusum(values : Array[Double], target : Double, allowance : Double) -> (Array[Double], Array[Double])

#
data_quality_report

fn data_quality_report(input_count~ : Int, valid_count~ : Int, invalid_count~ : Int, duplicate_count~ : Int, negative_count~ : Int, zero_count~ : Int, warnings~ : Array[String]) -> DataQualityReport

#
decide_policy

fn decide_policy(survival : Double, hazard : Double, target_survival : Double, hazard_limit : Double, hours_since_service : Double) -> PolicyDecision

#
decode_factor

fn decode_factor(code : Double, lower : Double, upper : Double) -> Double

#
defect_rate

fn defect_rate(defects : Int, opportunities : Int) -> MetricEstimate

#
delta_method

fn delta_method(mean_value : Double, standard_error : Double, transform : (Double) -> Double) -> MetricEstimate

Delta-method uncertainty for a scalar transform.

#
demonstrate_reliability

fn demonstrate_reliability(model : ReliabilityModel, times : Array[Double]) -> Array[MetricEstimate]

#
design_correlation

fn design_correlation(design : Array[DesignPoint], first_factor : Int, second_factor : Int) -> Double

#
design_point

fn design_point(id~ : Int, factors~ : Array[Double], replicate~ : Int, center~ : Bool) -> DesignPoint

#
detect_level_shift

fn detect_level_shift(values : Array[Double], minimum_segment : Int) -> Int?

#
diagnostic_result

fn diagnostic_result(statistic~ : Double, p_value~ : Double, passed~ : Bool, residuals~ : Array[Double], message~ : String) -> DiagnosticResult

#
digamma

fn digamma(x : Double) -> Double

#
distribution_sensitivity

fn distribution_sensitivity(model : ReliabilityModel, time : Double, parameter : String, perturbation : Double) -> SensitivityPoint

#
dot

fn dot(left : Array[Double], right : Array[Double]) -> Double

#
double_exponential_smoothing

fn double_exponential_smoothing(values : Array[Double], alpha : Double, beta : Double) -> Array[Double]

#
downtime_budget_from_availability

fn downtime_budget_from_availability(horizon : Double, target_availability : Double) -> Double

#
duane_average_failure_rate

fn duane_average_failure_rate(times : Array[Double]) -> Array[Double]

#
durbin_watson

fn durbin_watson(residuals : Array[Double]) -> Double

#
empirical_distribution

fn empirical_distribution(records : Array[LifeObservation]) -> EmpiricalDistribution

#
empirical_hazard

fn empirical_hazard(records : Array[LifeObservation]) -> Array[MetricEstimate]

#
empirical_tail_mean

fn empirical_tail_mean(values : Array[Double], threshold : Double) -> Double

#
empty_sample_summary

fn empty_sample_summary() -> SampleSummary

#
erf

fn erf(x : Double) -> Double

Error function approximation (Abramowitz and Stegun) Maximum error:

#
erfinv

fn erfinv(y : Double) -> Double

Inverse error function approximation

#
evaluate_alert

fn evaluate_alert(rule : AlertRule, values : Array[Double]) -> AlertDecision

#
evaluate_availability_alert

fn evaluate_availability_alert(window : TelemetryWindow, target : Double, minimum_samples : Int) -> AlertDecision

#
evaluate_burn_rate_alert

fn evaluate_burn_rate_alert(window : TelemetryWindow, target : Double, threshold : Double) -> AlertDecision

#
evaluate_mission

fn evaluate_mission(model : ReliabilityModel, segments : Array[MissionSegment]) -> MissionResult

#
evaluate_requirement

fn evaluate_requirement(model : ReliabilityModel, requirement : ReliabilityRequirement) -> RequirementResult

#
evaluate_requirements

fn evaluate_requirements(model : ReliabilityModel, requirements : Array[ReliabilityRequirement]) -> Array[RequirementResult]

#
evaluate_sla

fn evaluate_sla(failures : Array[Double], policy : SlaPolicy, observation_window : Double) -> SlaResult

#
ewma

fn ewma(values : Array[Double], lambda : Double, target : Double) -> Array[Double]

#
exceedance_probability

fn exceedance_probability(values : Array[Double], threshold : Double) -> Double

#
excess_kurtosis

fn excess_kurtosis(values : Array[Double]) -> Double

#
expected_downtime

fn expected_downtime(model : ReliabilityModel, horizon : Double) -> Double

#
expected_failures_in_window

fn expected_failures_in_window(model : ReliabilityModel, start : Double, stop : Double) -> Double

#
expected_fleet_failures

fn expected_fleet_failures(model : ReliabilityModel, fleet_size : Int, horizon : Double) -> Double

#
expected_queue_wait

fn expected_queue_wait(arrival_rate : Double, service_rate : Double, servers : Int) -> Double

#
expected_remaining_life

fn expected_remaining_life(model : ReliabilityModel, age : Double, horizon : Double) -> Double

#
expected_repair_queue_length

fn expected_repair_queue_length(arrival_rate : Double, service_rate : Double) -> Double

#
expected_risk_after_mitigation

fn expected_risk_after_mitigation(modes : Array[FailureModeContribution], reductions : Array[Double]) -> Double

#
expected_state_time

fn expected_state_time(matrix : TransitionMatrix, initial_state : Int, horizon : Double, step : Double, target_state : Int) -> Double

#
expected_warranty_claims

fn expected_warranty_claims(model : ReliabilityModel, policy : WarrantyPolicy) -> Double

#
expected_warranty_cost

fn expected_warranty_cost(model : ReliabilityModel, policy : WarrantyPolicy) -> Double

#
exponential_fit_censored

fn exponential_fit_censored(records : Array[LifeObservation]) -> FitResult

#
exponential_smoothing

fn exponential_smoothing(values : Array[Double], alpha : Double) -> Array[Double]

#
exposure_time

fn exposure_time(records : Array[LifeObservation], horizon : Double) -> Double

#
extreme_quantile

fn extreme_quantile(model : Pareto, return_period : Double) -> Double

#
factorial

fn factorial(n : Int) -> Double

#
failure

fn failure(time : Double) -> LifeObservation

Create an uncensored failure observation.

#
failure_fraction

fn failure_fraction(records : Array[LifeObservation]) -> Double

#
failure_mode_contribution

fn failure_mode_contribution(name~ : String, probability~ : Double, cost~ : Double) -> FailureModeContribution

#
failure_rate_estimate

fn failure_rate_estimate(records : Array[LifeObservation], horizon : Double) -> MetricEstimate

#
failure_rate_trend

fn failure_rate_trend(times : Array[Double]) -> Double

#
fault_tree_and

fn fault_tree_and(events : Array[Double]) -> FaultTreeResult

#
fault_tree_or

fn fault_tree_or(events : Array[Double]) -> FaultTreeResult

#
fault_tree_result

fn fault_tree_result(top_event_probability~ : Double, minimal_cut_sets~ : Array[Array[Int]], dominant_component~ : Int?) -> FaultTreeResult

#
finite_difference_sensitivity

fn finite_difference_sensitivity(parameter : String, baseline_parameter : Double, baseline_metric : Double, perturbation : Double, evaluator : (Double) -> Double) -> SensitivityPoint

#
finite_gradient

fn finite_gradient(point : Array[Double], objective : (Array[Double]) -> Double, step : Double) -> Array[Double]

#
finite_or

fn finite_or(value : Double, fallback~ : Double) -> Double

#
first_difference

fn first_difference(values : Array[Double]) -> Array[Double]

#
fit_arrhenius

fn fit_arrhenius(temperature : Array[Double], life : Array[Double], reference : Double) -> AcceleratedLifeModel

#
fit_bathtub_hazard

fn fit_bathtub_hazard(records : Array[LifeObservation]) -> BathtubHazard

#
fit_crow_amsaa

fn fit_crow_amsaa(times : Array[Double]) -> ReliabilityGrowthModel

#
fit_eyring

fn fit_eyring(temperature : Array[Double], stress : Array[Double], life : Array[Double], reference : Double) -> AcceleratedLifeModel

#
fit_inverse_power

fn fit_inverse_power(stress : Array[Double], life : Array[Double], reference : Double) -> AcceleratedLifeModel

#
fit_report

fn fit_report(fits : Array[FitResult]) -> String

#
fit_result

fn fit_result(distribution~ : String, parameters~ : Array[Double], log_likelihood~ : Double, aic~ : Double, bic~ : Double, iterations~ : Int, converged~ : Bool, standard_errors~ : Array[Double]) -> FitResult

#
fit_scale_by_mle

fn fit_scale_by_mle(records : Array[LifeObservation], shape : Double) -> OptimizationResult

#
fleet_plan

fn fleet_plan(fleet_size~ : Int, horizon~ : Double, expected_failures~ : Double, spare_units~ : Int, stockout_probability~ : Double, expected_downtime~ : Double) -> FleetPlan

#
fleet_reliability

fn fleet_reliability(model : ReliabilityModel, fleet_size : Int, horizon : Double, required_units : Int) -> Double

#
forecast_accuracy

fn forecast_accuracy(actual : Array[Double], predicted : Array[Double]) -> MetricEstimate

#
forecast_endpoint

fn forecast_endpoint(forecast : ForecastSeries) -> Double

#
forecast_linear

fn forecast_linear(values : Array[Double], horizon : Int) -> ForecastSeries

#
forecast_lower

fn forecast_lower(forecast : ForecastSeries) -> Array[Double]

#
forecast_result

fn forecast_result(points~ : Array[TimeSeriesPoint], algorithm~ : String, residual_scale~ : Double) -> ForecastResult

#
forecast_risk_score

fn forecast_risk_score(forecast : ForecastSeries, target : Double) -> Double

#
forecast_trend

fn forecast_trend(forecast : ForecastSeries) -> String

#
forecast_upper

fn forecast_upper(forecast : ForecastSeries) -> Array[Double]

#
forecast_values

fn forecast_values(forecast : ForecastSeries) -> Array[Double]

#
format_double

fn format_double(value : Double, digits : Int) -> String

Human-readable compact reporting helpers; no I/O is required.

#
format_fit

fn format_fit(fit : FitResult) -> String

#
format_metric

fn format_metric(metric : MetricEstimate) -> String

#
full_factorial

fn full_factorial(levels : Array[Array[Double]]) -> Array[DesignPoint]

#
gamma

fn gamma(z : Double) -> Double

Gamma function approximation using Lanczos approximation

#
gamma_fit

fn gamma_fit(observations : Array[Double]) -> FitResult

#
gamma_log

fn gamma_log(z : Double) -> Double

#
geometric_mean

fn geometric_mean(values : Array[Double]) -> Double

#
golden_section_minimize

fn golden_section_minimize(lower : Double, upper : Double, objective : (Double) -> Double, tolerance : Double) -> OptimizationResult

#
gompertz_fit

fn gompertz_fit(observations : Array[Double]) -> FitResult

#
grid_minimize

fn grid_minimize(grid : Array[Double], objective : (Double) -> Double) -> OptimizationResult

#
growth_phase

fn growth_phase(model : ReliabilityGrowthModel) -> String

#
harmonic_mean

fn harmonic_mean(values : Array[Double]) -> Double

#
hazard_curve

fn hazard_curve(model : ReliabilityModel, times : Array[Double]) -> Array[Double]

#
health_gap

fn health_gap(snapshot : HealthSnapshot, target : Double) -> Double

#
health_is_actionable

fn health_is_actionable(snapshot : HealthSnapshot) -> Bool

#
health_risk_index

fn health_risk_index(snapshot : HealthSnapshot) -> Double

#
health_score

fn health_score(snapshot : HealthSnapshot) -> Double

#
health_snapshot

fn health_snapshot(window : TelemetryWindow, target : Double) -> HealthSnapshot

#
health_status

fn health_status(snapshot : HealthSnapshot) -> String

#
holt_linear_trend

fn holt_linear_trend(values : Array[Double], alpha : Double, beta : Double) -> Array[Double]

#
impute_right_censoring

fn impute_right_censoring(times : Array[Double], censor_time : Double) -> Array[LifeObservation]

#
incident_availability

fn incident_availability(incidents : Array[IncidentRecord], window : Double) -> Double

#
incident_burden

fn incident_burden(incidents : Array[IncidentRecord], window : Double) -> Double

#
incident_count_by_cause

fn incident_count_by_cause(incidents : Array[IncidentRecord], cause : Int) -> Int

#
incident_count_by_severity

fn incident_count_by_severity(incidents : Array[IncidentRecord], severity : Int) -> Int

#
incident_duration

fn incident_duration(incident : IncidentRecord) -> Double

#
incident_is_open_at

fn incident_is_open_at(incident : IncidentRecord, timestamp : Double) -> Bool

#
incident_max_duration

fn incident_max_duration(incidents : Array[IncidentRecord]) -> Double

#
incident_mean_duration

fn incident_mean_duration(incidents : Array[IncidentRecord]) -> Double

#
incident_mtbf

fn incident_mtbf(incidents : Array[IncidentRecord], window : Double) -> Double

#
incident_mttr

fn incident_mttr(incidents : Array[IncidentRecord]) -> Double

#
incident_overlaps

fn incident_overlaps(left : IncidentRecord, right : IncidentRecord) -> Bool

#
incident_rate

fn incident_rate(incidents : Array[IncidentRecord], window : Double) -> Double

#
incident_record

fn incident_record(start~ : Double, end~ : Double, severity~ : Int, cause~ : Int) -> IncidentRecord

#
incident_severity_weight

fn incident_severity_weight(incidents : Array[IncidentRecord]) -> Double

#
incident_total_duration

fn incident_total_duration(incidents : Array[IncidentRecord]) -> Double

#
incident_union_duration

fn incident_union_duration(incidents : Array[IncidentRecord]) -> Double

#
indicator_weighted_score

fn indicator_weighted_score(values : Array[Double], weights : Array[Double]) -> Double

#
inspect_times

fn inspect_times(times : Array[Double]) -> DataQualityReport

#
inspection_interval

fn inspection_interval(model : ReliabilityModel, target_availability : Double, cost_of_inspection : Double, cost_of_failure : Double) -> Double

#
integrated_brier_score

fn integrated_brier_score(model : ReliabilityModel, records : Array[LifeObservation], start : Double, stop : Double, steps : Int) -> Double

#
interval_censored

fn interval_censored(lower : Double, upper : Double) -> LifeObservation

Create an interval-censored observation. The interval is represented by the midpoint for rank-based estimators; use interval_record when bounds must be retained for an interval likelihood.

#
interval_event_counts

fn interval_event_counts(records : Array[LifeObservation], grid : Array[Double]) -> Array[Int]

#
interval_record

fn interval_record(lower : Double, upper : Double) -> IntervalRecord

#
inverse_gaussian_fit

fn inverse_gaussian_fit(values : Array[Double]) -> FitResult

#
inverse_gaussian_mean_residual

fn inverse_gaussian_mean_residual(model : InverseGaussian, age : Double) -> Double

#
inverse_gaussian_reliability_margin

fn inverse_gaussian_reliability_margin(model : InverseGaussian, mission : Double, target : Double) -> Double

#
inverse_power_acceleration

fn inverse_power_acceleration(exponent : Double, use_stress : Double, reference_stress : Double) -> Double

#
is_improving

fn is_improving(model : ReliabilityGrowthModel) -> Bool

#
jackknife

fn jackknife(values : Array[Double], statistic : (Array[Double]) -> Double) -> BootstrapResult

#
k_out_of_n_components

fn k_out_of_n_components(k : Int, components : Array[Double]) -> Double

#
k_out_of_n_reliability

fn k_out_of_n_reliability(k : Int, component_reliability : Double, n : Int) -> Double

#
kaplan_meier

fn kaplan_meier(records : Array[LifeObservation]) -> SurvivalCurve

#
kolmogorov_smirnov_d

fn kolmogorov_smirnov_d(values : Array[Double]) -> Double

#
ks_normal_diagnostic

fn ks_normal_diagnostic(values : Array[Double], alpha : Double) -> DiagnosticResult

#
lag

fn lag(values : Array[Double], offset : Int) -> (Array[Double], Array[Double])

#
latin_hypercube

fn latin_hypercube(seed : Int, runs : Int, factors : Int) -> Array[DesignPoint]

#
left_censored

fn left_censored(time : Double) -> LifeObservation

Create a left-censored observation for a unit already failed at inspection.

#
life_ratio

fn life_ratio(model : ReliabilityModel, first_probability : Double, second_probability : Double) -> Double

#
life_table

fn life_table(intervals~ : Array[LifeTableInterval], total_failures~ : Int, restricted_mean~ : Double, final_survival~ : Double) -> LifeTable

#
life_table_csv

fn life_table_csv(table : LifeTable) -> String

#
life_table_interval

fn life_table_interval(lower~ : Double, upper~ : Double, exposed~ : Double, failures~ : Int, withdrawals~ : Int, failure_probability~ : Double, survival_probability~ : Double, hazard~ : Double) -> LifeTableInterval

#
likelihood_ratio

fn likelihood_ratio(first : FitResult, second : FitResult) -> Double

fn line_search(initial : Double, direction : Double, objective : (Double) -> Double) -> Double

#
linear_regression

fn linear_regression(x : Array[Double], y : Array[Double]) -> RegressionResult

#
linspace

fn linspace(start : Double, stop : Double, count : Int) -> Array[Double]

#
log_factorial

fn log_factorial(n : Int) -> Double

#
loglogistic_fit

fn loglogistic_fit(observations : Array[Double]) -> FitResult

#
lognormal_fit_censored

fn lognormal_fit_censored(records : Array[LifeObservation]) -> FitResult

#
lognormal_mean_uncertainty

fn lognormal_mean_uncertainty(mu : Double, sigma : Double, mu_error : Double, sigma_error : Double) -> MetricEstimate

#
longest_outage

fn longest_outage(outages : Array[OutageRecord]) -> OutageRecord

#
maintenance_schedule

fn maintenance_schedule(ages~ : Array[Double], actions~ : Array[MaintenanceAction], expected_costs~ : Array[Double], expected_availability~ : Array[Double], selected_age~ : Double) -> MaintenanceSchedule

#
markov_availability

fn markov_availability(failure_rate : Double, repair_rate : Double, time : Double) -> Double

#
markov_availability_curve

fn markov_availability_curve(failure_rate : Double, repair_rate : Double, horizon : Double, steps : Int) -> Array[AvailabilityPoint]

#
max_value

fn max_value(values : Array[Double]) -> Double

#
mean

fn mean(values : Array[Double]) -> Double

#
mean_absolute_percentage_error

fn mean_absolute_percentage_error(actual : Array[Double], predicted : Array[Double]) -> Double

#
mean_residual_life

fn mean_residual_life(records : Array[LifeObservation], grid : Array[Double]) -> Array[Double]

Compute a mean residual life curve at selected inspection times.

#
median_absolute_deviation

fn median_absolute_deviation(values : Array[Double]) -> Double

#
merge_observations

fn merge_observations(first : Array[LifeObservation], second : Array[LifeObservation]) -> Array[LifeObservation]

#
metric_estimate

fn metric_estimate(estimate~ : Double, lower~ : Double, upper~ : Double, confidence_level~ : Double) -> MetricEstimate

#
min_value

fn min_value(values : Array[Double]) -> Double

#
minimal_cut_set_probability

fn minimal_cut_set_probability(cut : Array[Int], component_failure_probabilities : Array[Double]) -> Double

#
mission_margin

fn mission_margin(result : MissionResult, target_survival : Double) -> Double

#
mission_profile_grid

fn mission_profile_grid(start : Double, duration : Double, segments : Int, stress : Double) -> Array[MissionSegment]

#
mission_profile_requirement

fn mission_profile_requirement(name : String, model : ReliabilityModel, checkpoints : Array[Double], target : Double, confidence : Double, penalty : Double) -> Array[ReliabilityRequirement]

#
mission_reliability_with_derating

fn mission_reliability_with_derating(model : ReliabilityModel, segments : Array[MissionSegment], derating : Double) -> Double

#
mission_result

fn mission_result(survival~ : Double, cumulative_hazard~ : Double, segment_hazards~ : Array[Double], expected_failures~ : Double) -> MissionResult

#
mission_segment

fn mission_segment(start~ : Double, duration~ : Double, stress_multiplier~ : Double) -> MissionSegment

#
mission_stress_sensitivity

fn mission_stress_sensitivity(model : ReliabilityModel, segments : Array[MissionSegment], perturbation : Double) -> SensitivityPoint

#
mission_success_probability

fn mission_success_probability(models : Array[ReliabilityModel], mission_time : Double) -> Double

#
mixture_cdf

fn mixture_cdf(models : Array[ReliabilityModel], weights : Array[Double], time : Double) -> Double

#
mixture_quantile

fn mixture_quantile(models : Array[ReliabilityModel], weights : Array[Double], p : Double, upper : Double) -> Double

#
mixture_survival

fn mixture_survival(models : Array[ReliabilityModel], weights : Array[Double], time : Double) -> Double

#
mode_risk_share

fn mode_risk_share(mode : FailureModeContribution, modes : Array[FailureModeContribution]) -> Double

#
model_brier_score

fn model_brier_score(model : ReliabilityModel, records : Array[LifeObservation], time : Double) -> Double

#
model_calibration_error

fn model_calibration_error(model : ReliabilityModel, records : Array[LifeObservation], bins : Int) -> Double

#
model_comparison

fn model_comparison(names~ : Array[String], log_likelihoods~ : Array[Double], aic~ : Array[Double], bic~ : Array[Double], preferred_aic~ : Int, preferred_bic~ : Int) -> ModelComparison

#
model_from_fit

fn model_from_fit(fit : FitResult) -> ReliabilityModel

#
model_hazard

fn model_hazard(model : ReliabilityModel, time : Double) -> Double

#
model_mean

fn model_mean(model : ReliabilityModel) -> Double

#
model_metric

fn model_metric(model : ReliabilityModel, time : Double, confidence_level : Double) -> MetricEstimate

#
model_quantile

fn model_quantile(model : ReliabilityModel, probability : Double) -> Double

#
monitoring_interval

fn monitoring_interval(score : Double, base_hours : Double) -> Double

#
monte_carlo_reliability

fn monte_carlo_reliability(seed : Int, model : ReliabilityModel, time : Double, replications : Int) -> MetricEstimate

#
monte_carlo_series

fn monte_carlo_series(seed : Int, models : Array[ReliabilityModel], time : Double, replications : Int) -> MetricEstimate

#
monthly_downtime_budget

fn monthly_downtime_budget(window : Double, promised_availability : Double) -> Double

#
moving_average

fn moving_average(values : Array[Double], window : Int) -> Array[Double]

#
moving_standard_deviation

fn moving_standard_deviation(values : Array[Double], window : Int) -> Array[Double]

#
mtbf_from_events

fn mtbf_from_events(event_times : Array[Double]) -> Double

#
mttf

fn mttf(records : Array[LifeObservation]) -> Double

Event-level engineering metrics derived from mixed lifetime records.

#
negative_change_fraction

fn negative_change_fraction(values : Array[Double]) -> Double

#
nelson_aalen

fn nelson_aalen(records : Array[LifeObservation]) -> SurvivalCurve

#
network_component_importance

fn network_component_importance(network : NetworkReliability, components : Array[Double]) -> Array[Double]

#
network_failure_probability

fn network_failure_probability(network : NetworkReliability) -> Double

#
network_min_cut

fn network_min_cut(paths : Array[Array[Int]]) -> Array[Array[Int]]

#
network_redundancy_gain

fn network_redundancy_gain(base : NetworkReliability, redundant : NetworkReliability) -> Double

#
network_reliability

fn network_reliability(component_count~ : Int, paths~ : Array[Array[Int]], reliability~ : Double, path_contributions~ : Array[Double]) -> NetworkReliability

#
network_reliability_from_paths

fn network_reliability_from_paths(component_count : Int, paths : Array[Array[Int]], components : Array[Double]) -> NetworkReliability

#
newton_solve

fn newton_solve(initial : Double, function : (Double) -> Double, derivative : (Double) -> Double, lower : Double, upper : Double, max_iterations : Int) -> (Double, Int, Bool)

#
normal_fit

fn normal_fit(observations : Array[Double]) -> FitResult

#
normal_log_likelihood

fn normal_log_likelihood(model : Normal, observations : Array[Double]) -> Double

#
observability_exponential_smoothing

fn observability_exponential_smoothing(values : Array[Double], alpha : Double) -> Array[Double]

#
observation_summary_markdown

fn observation_summary_markdown(summary : SampleSummary) -> String

#
observed_event_count

fn observed_event_count(records : Array[LifeObservation]) -> Int

#
one_at_a_time

fn one_at_a_time(names : Array[String], baselines : Array[Double], metric : (Array[Double]) -> Double, fraction : Double) -> Array[SensitivityPoint]

#
optimization_result

fn optimization_result(parameter~ : Double, objective~ : Double, iterations~ : Int, converged~ : Bool) -> OptimizationResult

#
optimize_replacement_age

fn optimize_replacement_age(model : ReliabilityModel, minimum_age : Double, maximum_age : Double, steps : Int, replacement_cost : Double) -> Double

#
optimum_renewal_age

fn optimum_renewal_age(model : ReliabilityModel, replacement_cost : Double, reward_per_time : Double, start : Double, stop : Double, steps : Int) -> Double

#
outage_cause_counts

fn outage_cause_counts(outages : Array[OutageRecord]) -> Map[Int, Int]

#
outage_metrics

fn outage_metrics(saidi~ : Double, saifi~ : Double, caidi~ : Double, asai~ : Double, maifi~ : Double, total_customer_interruptions~ : Int) -> OutageMetrics

#
outage_quantiles

fn outage_quantiles(outages : Array[OutageRecord], probabilities : Array[Double]) -> Array[Double]

#
outage_rate

fn outage_rate(outages : Array[OutageRecord], window : Double) -> Double

#
outage_record

fn outage_record(customer~ : Int, start~ : Double, duration~ : Double, customers_affected~ : Int, cause~ : Int) -> OutageRecord

#
parallel_hazard

fn parallel_hazard(models : Array[ReliabilityModel], time : Double) -> Double

#
parallel_reliability

fn parallel_reliability(components : Array[Double]) -> Double

#
pareto_fit

fn pareto_fit(values : Array[Double]) -> FitResult

#
path_reliability

fn path_reliability(path : Array[Int], components : Array[Double]) -> Double

#
percentile_exceedance

fn percentile_exceedance(values : Array[Double], threshold : Double, percentile : Double) -> Double

#
percentile_life

fn percentile_life(model : ReliabilityModel, percentiles : Array[Double]) -> Array[MetricEstimate]

#
percentile_rank

fn percentile_rank(sorted : Array[Double], value : Double) -> Double

#
plan_fleet

fn plan_fleet(model : ReliabilityModel, fleet_size : Int, horizon : Double, target_stockout_probability : Double, repair_duration : Double) -> FleetPlan

#
poisson_confidence

fn poisson_confidence(count : Int, exposure : Double, confidence : Double) -> MetricEstimate

#
poisson_rate

fn poisson_rate(count : Int, exposure : Double) -> MetricEstimate

#
policy_action_label

fn policy_action_label(action : PolicyAction) -> String

#
policy_breach_count

fn policy_breach_count(scores : Array[Double], threshold : Double) -> Int

#
policy_compliance

fn policy_compliance(decisions : Array[PolicyDecision]) -> Double

#
policy_decision

fn policy_decision(action~ : PolicyAction, score~ : Double, reason~ : String, urgency_hours~ : Double) -> PolicyDecision

#
policy_decisions_for_curve

fn policy_decisions_for_curve(model : ReliabilityModel, times : Array[Double], target : Double, hazard_limit : Double) -> Array[PolicyDecision]

#
policy_report

fn policy_report(decisions : Array[PolicyDecision]) -> String

#
policy_risk_score

fn policy_risk_score(model : ReliabilityModel, time : Double, target : Double, hazard_limit : Double) -> Double

#
policy_score_curve

fn policy_score_curve(model : ReliabilityModel, times : Array[Double], target : Double, hazard_limit : Double) -> Array[Double]

#
polynomial_regression

fn polynomial_regression(x : Array[Double], y : Array[Double], degree : Int) -> RegressionResult

#
positive_change_fraction

fn positive_change_fraction(values : Array[Double]) -> Double

#
predict_regression

fn predict_regression(model : RegressionResult, x : Double) -> Double

#
preventive_replacement_cost

fn preventive_replacement_cost(model : ReliabilityModel, age : Double, replacement_cost : Double) -> Double

#
probability_integral_residuals

fn probability_integral_residuals(model : ReliabilityModel, records : Array[LifeObservation]) -> Array[Double]

#
propagate_independent_uncertainty

fn propagate_independent_uncertainty(means : Array[Double], standard_errors : Array[Double], evaluator : (Array[Double]) -> Double) -> MetricEstimate

#
proportional_hazards_score

fn proportional_hazards_score(records : Array[LifeObservation], covariate : Array[Double]) -> RegressionResult

#
quantile

fn quantile(values : Array[Double], p : Double) -> Double

#
quantile_quantile_pairs

fn quantile_quantile_pairs(model : ReliabilityModel, observations : Array[Double]) -> Array[(Double, Double)]

#
quantile_rank

fn quantile_rank(values : Array[Double], value : Double) -> Double

#
quantile_sorted

fn quantile_sorted(sorted : Array[Double], p : Double) -> Double

#
quantile_spacing

fn quantile_spacing(model : ReliabilityModel, probabilities : Array[Double]) -> Array[Double]

#
rank_failure_modes

fn rank_failure_modes(modes : Array[FailureModeContribution]) -> Array[FailureModeContribution]

#
rank_risks

fn rank_risks(items : Array[RiskItem]) -> Array[RiskItem]

#
rank_values

fn rank_values(values : Array[Double]) -> Array[Double]

#
recommendation_count

fn recommendation_count(scorecard : ReliabilityScorecard) -> Int

#
reduce_mode_probability

fn reduce_mode_probability(mode : FailureModeContribution, reduction : Double) -> FailureModeContribution

#
regression_markdown

fn regression_markdown(model : RegressionResult) -> String

#
regression_result

fn regression_result(coefficients~ : Array[Double], standard_errors~ : Array[Double], fitted~ : Array[Double], residuals~ : Array[Double], r_squared~ : Double, adjusted_r_squared~ : Double, residual_sum_squares~ : Double, observations~ : Int) -> RegressionResult

#
regularized_gamma_p

fn regularized_gamma_p(a : Double, x : Double) -> Double

Lower regularized incomplete gamma using a power series for x < a+1.

#
regularized_gamma_q

fn regularized_gamma_q(a : Double, x : Double) -> Double

Upper regularized incomplete gamma using a continued fraction.

#
reliability_at

fn reliability_at(model : ReliabilityModel, times : Array[Double]) -> Array[Double]

#
reliability_budget

fn reliability_budget(window : TelemetryWindow, target : Double) -> ReliabilityBudget

#
reliability_growth_model

fn reliability_growth_model(intercept~ : Double, shape~ : Double, scale~ : Double, fit~ : RegressionResult) -> ReliabilityGrowthModel

#
reliability_margin

fn reliability_margin(model : ReliabilityModel, mission_time : Double, target : Double) -> Double

#
reliability_requirement

fn reliability_requirement(name~ : String, mission_time~ : Double, minimum_survival~ : Double, confidence_level~ : Double, penalty~ : Double) -> ReliabilityRequirement

#
reliability_scorecard

fn reliability_scorecard(reliability_score~ : Double, availability_score~ : Double, quality_score~ : Double, maintenance_score~ : Double, overall_score~ : Double, grade~ : String, recommendations~ : Array[String]) -> ReliabilityScorecard

#
reliability_snapshot

fn reliability_snapshot(model : ReliabilityModel, time : Double, mission_count : Int) -> ReliabilitySnapshot

#
reliability_system

fn reliability_system(name~ : String, logic~ : SystemLogic, component_reliabilities~ : Array[Double], reliability~ : Double, importance~ : Array[Double]) -> ReliabilitySystem

#
remove_nonpositive

fn remove_nonpositive(values : Array[Double]) -> Array[Double]

#
renewal_reward_rate

fn renewal_reward_rate(model : ReliabilityModel, replacement_cost : Double, reward_per_time : Double, age : Double) -> Double

#
repair_queue_utilization

fn repair_queue_utilization(arrival_rate : Double, service_rate : Double) -> Double

#
repairable_availability

fn repairable_availability(failure_rate : Double, repair_rate : Double) -> Double

#
replicate_design

fn replicate_design(design : Array[DesignPoint], replicates : Int) -> Array[DesignPoint]

#
required_sample_size

fn required_sample_size(expected_proportion : Double, half_width : Double, confidence : Double) -> Int

#
required_scale_for_mission

fn required_scale_for_mission(shape : Double, target : Double, mission_time : Double) -> Double

#
requirement_breach_time

fn requirement_breach_time(model : ReliabilityModel, target : Double, confidence : Double, start : Double, stop : Double, steps : Int) -> Double?

#
requirement_pass_rate

fn requirement_pass_rate(results : Array[RequirementResult]) -> Double

#
requirement_result

fn requirement_result(requirement~ : String, estimate~ : Double, lower_bound~ : Double, margin~ : Double, passed~ : Bool, penalty~ : Double, explanation~ : String) -> RequirementResult

#
residual_standard_error

fn residual_standard_error(model : RegressionResult) -> Double

#
residual_summary

fn residual_summary(diagnostic : DiagnosticResult) -> SampleSummary

#
restoration_curve

fn restoration_curve(outages : Array[OutageRecord], grid : Array[Double]) -> Array[Double]

#
right_censored

fn right_censored(time : Double) -> LifeObservation

Create a right-censored observation, for example a unit still running at the end of a test or a customer who left the service before failure.

#
risk_item

fn risk_item(name~ : String, severity~ : Int, occurrence~ : Int, detection~ : Int, recommended_action~ : String) -> RiskItem

#
risk_level

fn risk_level(priority_number : Int) -> String

#
risk_matrix_score

fn risk_matrix_score(severity : Int, occurrence : Int, detection : Int) -> Int

#
risk_reduction

fn risk_reduction(original : RiskItem, improved_detection : Int) -> Double

#
rolling_autocorrelation

fn rolling_autocorrelation(values : Array[Double], lag : Int, window : Int) -> Array[Double]

#
rolling_availability

fn rolling_availability(points : Array[TelemetryPoint], window_size : Int, step : Int) -> Array[Double]

#
rolling_burn_rates

fn rolling_burn_rates(points : Array[TelemetryPoint], window_size : Int, step : Int, target : Double) -> Array[Double]

#
rolling_failure_rates

fn rolling_failure_rates(points : Array[TelemetryPoint], window_size : Int, step : Int) -> Array[Double]

#
rolling_health

fn rolling_health(points : Array[TelemetryPoint], window_size : Int, step : Int, target : Double) -> Array[Double]

#
rolling_means

fn rolling_means(points : Array[TelemetryPoint], window_size : Int, step : Int) -> Array[Double]

#
rolling_quantile

fn rolling_quantile(values : Array[Double], window : Int, p : Double) -> Array[Double]

#
rolling_standard_deviations

fn rolling_standard_deviations(points : Array[TelemetryPoint], window_size : Int, step : Int) -> Array[Double]

#
rolling_windows

fn rolling_windows(points : Array[TelemetryPoint], window_size : Int, step : Int) -> Array[TelemetryWindow]

#
root_mean_square_error

fn root_mean_square_error(actual : Array[Double], predicted : Array[Double]) -> Double

#
run_rules

fn run_rules(values : Array[Double], limits : ControlLimits) -> Array[String]

#
safe_log_probability

fn safe_log_probability(p : Double) -> Double

#
safety_integrity_level

fn safety_integrity_level(pfd : Double) -> String

#
sample_exponential

fn sample_exponential(seed : Int, lambda : Double, count : Int) -> Array[Double]

#
sample_lognormal

fn sample_lognormal(seed : Int, mu : Double, sigma : Double, count : Int) -> Array[Double]

#
sample_weibull

fn sample_weibull(seed : Int, scale : Double, shape : Double, count : Int) -> Array[Double]

#
scale_vector

fn scale_vector(values : Array[Double], factor : Double) -> Array[Double]

#
score_checksum

fn score_checksum(scores : Array[Double]) -> Double

#
score_gap

fn score_gap(score : Double, target : Double) -> Double

#
score_grade

fn score_grade(score : Double) -> String

#
score_is_passing

fn score_is_passing(score : Double, target : Double) -> Bool

#
score_label

fn score_label(score : Double) -> String

#
score_to_percent

fn score_to_percent(score : Double) -> Double

#
score_trend

fn score_trend(previous : ReliabilityScorecard, current : ReliabilityScorecard) -> Double

#
scorecard_risk_flag

fn scorecard_risk_flag(scorecard : ReliabilityScorecard, threshold : Double) -> Bool

#
seasonal_difference

fn seasonal_difference(values : Array[Double], period : Int) -> Array[Double]

#
seasonal_index

fn seasonal_index(values : Array[Double], period : Int) -> Array[Double]

#
segment_failure_times

fn segment_failure_times(times : Array[Double], segments : Int) -> Array[Array[Double]]

#
semi_markov_cycle_time

fn semi_markov_cycle_time(uptime : Double, downtime : Double) -> Double

#
sensitivity_point

fn sensitivity_point(parameter~ : String, baseline~ : Double, perturbed~ : Double, absolute_change~ : Double, relative_change~ : Double, elasticity~ : Double) -> SensitivityPoint

#
series_hazard

fn series_hazard(models : Array[ReliabilityModel], time : Double) -> Double

#
series_reliability

fn series_reliability(components : Array[Double]) -> Double

#
service_capacity

fn service_capacity(arrival_rate : Double, average_service_time : Double, target_utilization : Double) -> Int

#
service_level

fn service_level(model : ReliabilityModel, response_time : Double, target : Double) -> MetricEstimate

#
shewhart_limits

fn shewhart_limits(values : Array[Double], sigma_multiplier : Double) -> ControlLimits

#
simple_forecast

fn simple_forecast(values : Array[Double], horizon : Int, alpha : Double, step : Double) -> ForecastResult

#
simulate_exponential_records

fn simulate_exponential_records(seed : Int, lambda : Double, count : Int, censor_time : Double) -> Array[LifeObservation]

#
simulate_weibull_records

fn simulate_weibull_records(seed : Int, scale : Double, shape : Double, count : Int, censor_time : Double) -> Array[LifeObservation]

#
skewness

fn skewness(values : Array[Double]) -> Double

#
sla_policy

fn sla_policy(window~ : Double, promised_availability~ : Double, credit_rate~ : Double, maximum_credit~ : Double) -> SlaPolicy

#
sla_result

fn sla_result(observed_availability~ : Double, downtime~ : Double, breach~ : Bool, credit~ : Double, error_budget_remaining~ : Double, confidence~ : MetricEstimate) -> SlaResult

#
smoothing_mae

fn smoothing_mae(values : Array[Double], smoothed : Array[Double]) -> Double

#
smoothing_residuals

fn smoothing_residuals(values : Array[Double], smoothed : Array[Double]) -> Array[Double]

#
smoothing_rmse

fn smoothing_rmse(values : Array[Double], smoothed : Array[Double]) -> Double

#
snapshot_checksum

fn snapshot_checksum(snapshots : Array[ReliabilitySnapshot]) -> Double

#
snapshot_expected_failures

fn snapshot_expected_failures(snapshot : ReliabilitySnapshot, population : Int) -> Double

#
snapshot_failure_probability

fn snapshot_failure_probability(snapshot : ReliabilitySnapshot) -> Double

#
snapshot_margin

fn snapshot_margin(snapshot : ReliabilitySnapshot, target : Double) -> Double

#
snapshot_series

fn snapshot_series(model : ReliabilityModel, times : Array[Double], mission_count : Int) -> Array[ReliabilitySnapshot]

#
snapshot_target_time

fn snapshot_target_time(model : ReliabilityModel, target : Double) -> Double

#
solve_linear_system

fn solve_linear_system(matrix : Array[Array[Double]], rhs : Array[Double]) -> Array[Double]

Solve a small dense linear system with partial pivoting.

#
sort_observations

fn sort_observations(records : Array[LifeObservation]) -> Array[LifeObservation]

Return a copy of records sorted by observed time, preserving equal-time observations for tied-event estimators.

#
spare_stockout_probability

fn spare_stockout_probability(expected_failures : Double, spare_units : Int) -> Double

#
standard_normal_cdf

fn standard_normal_cdf(x : Double) -> Double

Standard normal cumulative distribution function (CDF)

#
standard_normal_inv

fn standard_normal_inv(p : Double) -> Double

Inverse standard normal CDF (Probit function)

#
state_occupancy

fn state_occupancy(matrix : TransitionMatrix, initial_state : Int, horizon : Double, step : Double) -> Array[Double]

#
steady_state_distribution

fn steady_state_distribution(matrix : TransitionMatrix, tolerance : Double, max_iterations : Int) -> Array[Double]

#
steady_state_unavailability

fn steady_state_unavailability(failure_rate : Double, repair_rate : Double) -> Double

#
stratify_observations

fn stratify_observations(records : Array[LifeObservation], strata : Array[Int]) -> Map[Int, Array[LifeObservation]]

#
summarize

fn summarize(records : Array[LifeObservation]) -> SampleSummary

Return a complete descriptive summary for mixed failure/censoring data.

#
summarize_incidents

fn summarize_incidents(incidents : Array[IncidentRecord], window : Double) -> IncidentSummary

#
survival_confidence_interval

fn survival_confidence_interval(point : SurvivalPoint, confidence_level : Double) -> MetricEstimate

#
survival_curve_csv

fn survival_curve_csv(curve : SurvivalCurve) -> String

#
survival_point

fn survival_point(time~ : Double, at_risk~ : Int, events~ : Int, censored~ : Int, survival~ : Double, standard_error~ : Double, cumulative_hazard~ : Double) -> SurvivalPoint

#
tail_probability

fn tail_probability(model : Pareto, threshold : Double) -> Double

#
telemetry_point

fn telemetry_point(timestamp~ : Double, value~ : Double, healthy~ : Bool, weight~ : Double) -> TelemetryPoint

#
telemetry_window

fn telemetry_window(points : Array[TelemetryPoint], start~ : Double, end~ : Double, interval~ : Double) -> TelemetryWindow

#
telemetry_window_above

fn telemetry_window_above(window : TelemetryWindow, threshold : Double) -> Int

#
telemetry_window_availability

fn telemetry_window_availability(window : TelemetryWindow) -> Double

#
telemetry_window_below

fn telemetry_window_below(window : TelemetryWindow, threshold : Double) -> Int

#
telemetry_window_burn_rate

fn telemetry_window_burn_rate(window : TelemetryWindow, target : Double) -> Double

#
telemetry_window_coefficient_of_variation

fn telemetry_window_coefficient_of_variation(window : TelemetryWindow) -> Double

#
telemetry_window_count

fn telemetry_window_count(window : TelemetryWindow) -> Int

#
telemetry_window_coverage

fn telemetry_window_coverage(window : TelemetryWindow) -> Double

#
telemetry_window_downtime

fn telemetry_window_downtime(window : TelemetryWindow) -> Double

#
telemetry_window_duration

fn telemetry_window_duration(window : TelemetryWindow) -> Double

#
telemetry_window_error_budget

fn telemetry_window_error_budget(window : TelemetryWindow, target : Double) -> Double

#
telemetry_window_event_count

fn telemetry_window_event_count(window : TelemetryWindow) -> Int

#
telemetry_window_failure_rate

fn telemetry_window_failure_rate(window : TelemetryWindow) -> Double

#
telemetry_window_first

fn telemetry_window_first(window : TelemetryWindow) -> Double

#
telemetry_window_gap

fn telemetry_window_gap(window : TelemetryWindow) -> Double

#
telemetry_window_healthy_count

fn telemetry_window_healthy_count(window : TelemetryWindow) -> Int

#
telemetry_window_last

fn telemetry_window_last(window : TelemetryWindow) -> Double

#
telemetry_window_maximum

fn telemetry_window_maximum(window : TelemetryWindow) -> Double

#
telemetry_window_mean

fn telemetry_window_mean(window : TelemetryWindow) -> Double

#
telemetry_window_minimum

fn telemetry_window_minimum(window : TelemetryWindow) -> Double

#
telemetry_window_normalized

fn telemetry_window_normalized(window : TelemetryWindow) -> Array[Double]

#
telemetry_window_range

fn telemetry_window_range(window : TelemetryWindow) -> Double

#
telemetry_window_standard_deviation

fn telemetry_window_standard_deviation(window : TelemetryWindow) -> Double

#
telemetry_window_threshold_count

fn telemetry_window_threshold_count(window : TelemetryWindow, lower : Double, upper : Double) -> Int

#
telemetry_window_unhealthy_count

fn telemetry_window_unhealthy_count(window : TelemetryWindow) -> Int

#
telemetry_window_values

fn telemetry_window_values(window : TelemetryWindow) -> Array[Double]

#
telemetry_window_variance

fn telemetry_window_variance(window : TelemetryWindow) -> Double

#
telemetry_window_weight

fn telemetry_window_weight(window : TelemetryWindow) -> Double

#
thermal_stress_grid

fn thermal_stress_grid(start : Double, stop : Double, count : Int) -> Array[Double]

#
threshold_crossing

fn threshold_crossing(model : ReliabilityModel, target_reliability : Double, start : Double, stop : Double, steps : Int) -> Double?

#
time_series_point

fn time_series_point(time~ : Double, value~ : Double, lower~ : Double, upper~ : Double) -> TimeSeriesPoint

#
tornado_order

fn tornado_order(points : Array[SensitivityPoint]) -> Array[SensitivityPoint]

#
total_absolute_change

fn total_absolute_change(values : Array[Double]) -> Double

#
total_contract_penalty

fn total_contract_penalty(results : Array[RequirementResult]) -> Double

#
total_exposure

fn total_exposure(records : Array[LifeObservation]) -> Double

#
total_failure_mode_risk

fn total_failure_mode_risk(modes : Array[FailureModeContribution]) -> Double

#
transform_interval

fn transform_interval(metric : MetricEstimate, transform : (Double) -> Double) -> MetricEstimate

#
transition_matrix

fn transition_matrix(values : Array[Array[Double]]) -> TransitionMatrix

#
trigamma

fn trigamma(x : Double) -> Double

#
trimmed_mean

fn trimmed_mean(values : Array[Double], trim_fraction : Double) -> Double

#
truncated_model

fn truncated_model(base~ : ReliabilityModel, lower~ : Double, upper~ : Double) -> TruncatedModel

#
two_state_transition

fn two_state_transition(failure_rate : Double, repair_rate : Double, step : Double) -> TransitionMatrix

#
validate_dataset

fn validate_dataset(records : Array[LifeObservation]) -> Array[String]

Validate a data set before passing it to an estimator.

#
validate_observation

fn validate_observation(record : LifeObservation) -> String?

Validate a lifetime record and return a descriptive error string, or None.

#
validation_split

fn validation_split(values : Array[Double], fraction : Double) -> (Array[Double], Array[Double])

#
variance

fn variance(values : Array[Double], unbiased? : Bool) -> Double

#
warm_standby_reliability

fn warm_standby_reliability(primary : ReliabilityModel, standby : ReliabilityModel, time : Double) -> Double

#
warranty_analysis

fn warranty_analysis(claims~ : Double, expected_cost~ : Double, cost_per_unit_time~ : Double, claim_probability~ : Double, renewal_cycles~ : Double) -> WarrantyAnalysis

#
warranty_policy

fn warranty_policy(duration~ : Double, replacement_cost~ : Double, service_cost~ : Double, salvage_value~ : Double, renewal~ : Bool) -> WarrantyPolicy

#
warranty_replacement_threshold

fn warranty_replacement_threshold(policy : WarrantyPolicy, administrative_cost : Double) -> Double

#
weibull_fit_censored

fn weibull_fit_censored(records : Array[LifeObservation]) -> FitResult

Estimate Weibull shape and scale with a bounded Newton update on the profile likelihood. Right-censored records contribute exposure to the survival term and failures contribute the density term.

#
weibull_probability_plot

fn weibull_probability_plot(records : Array[LifeObservation]) -> RegressionResult

A log-log reliability regression where slope is the Weibull shape.

#
weighted_linear_regression

fn weighted_linear_regression(x : Array[Double], y : Array[Double], weights : Array[Double]) -> RegressionResult

#
weighted_mean

fn weighted_mean(values : Array[Double], weights : Array[Double]) -> Double

#
weighted_quantile

fn weighted_quantile(values : Array[Double], weights : Array[Double], p : Double) -> Double

#
weighted_reliability_score

fn weighted_reliability_score(availability : Double, stability : Double, incident_burden_value : Double, target : Double) -> Double

#
weighted_sum

fn weighted_sum(values : Array[Double], weights : Array[Double]) -> Double

#
weighted_variance

fn weighted_variance(values : Array[Double], weights : Array[Double]) -> Double

#
winsorize

fn winsorize(values : Array[Double], lower_probability : Double, upper_probability : Double) -> Array[Double]