Package: kofn 0.4.0

Alexander Towell

kofn: Maximum Likelihood Estimation for k-Out-of-n System Data

Maximum likelihood estimation of component lifetime parameters from system-level observations of k-out-of-n systems. Supports exponential and Weibull component distributions under multiple observation schemes: Scheme 0 (system lifetime only), Scheme 1 (periodic inspection), and Scheme 2 (complete monitoring). Provides an EM algorithm for Weibull parallel systems and Fisher information comparison across schemes. The k-out-of-n framework unifies series (k=1) and parallel (k=m) systems as a censoring problem on component lifetimes. Conforms to the 'likelihood.model' generics and returns fitted objects compatible with 'algebraic.mle'. The data-generating process and topology infrastructure (system survival, density, signature, structure function, importance measures) are delegated to the 'dist.structure' package; 'kofn' focuses exclusively on inference for the k-out-of-n family.

Authors:Alexander Towell [aut, cre]

kofn_0.4.0.tar.gz
kofn_0.4.0.tar.gz(r-4.7-any)kofn_0.4.0.tar.gz(r-4.6-any)
kofn_0.4.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
kofn/json (API)
NEWS

# Install 'kofn' in R:
install.packages('kofn', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/queelius/kofn/issues

Pkgdown/docs site:https://queelius.github.io

On CRAN:

Conda:

3.54 score 9 scripts 32 exports 12 dependencies

Last updated from:74039558aa. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK180
source / vignettesOK317
linux-release-x86_64OK180
wasm-releaseOK105

Exports:assumptionscompare_fisher_infodfr_exponentialdfr_weibullF_sys_expfitfit_scheme1hess_loglikie_expandis_kofnkofnloglikloglik_maskedloglik_scheme1ncomponentsobserve_exactobserve_interval_censorobserve_left_censorobserve_mixtureobserve_periodicobserve_right_censorrdatardata_maskedrdata_scheme1S_sys_expscoresolve_mletrunc_log_moment_vectrunc_pow_momenttrunc_pow_moment_vecw_j_exactw_j_integral

Dependencies:algebraic.distalgebraic.mlebootcompositional.mledist.structureflexhazgenericslikelihood.modelMASSmvtnormnumDerivR6

dist.structure integration

Rendered fromdist-structure-integration.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Exponential Parallel Systems: Closed-Form MLE via Inclusion-Exclusion

Rendered fromexponential-parallel.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Getting started with kofn

Rendered fromgetting-started.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Inside kofn: Building on the rlang MLE Stack

Rendered fromecosystem.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Observation Scheme Composability

Rendered fromobservation-schemes.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Observation Schemes: Resolving Information Asymmetry via Periodic Inspection

Rendered fromperiodic-inspection.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Weibull Parallel Systems: EM Algorithm for Shape-Scale Estimation

Rendered fromweibull-em.Rmdusingknitr::rmarkdownon Jun 19 2026.

Last update: 2026-06-19
Started: 2026-06-19

Readme and manuals

Help Manual

Help pageTopics
Assumptions for exponential k-out-of-n modelassumptions.exp_kofn
Assumptions for Weibull k-out-of-n system modelassumptions.wei_kofn
Compare Fisher information across observation schemescompare_fisher_info
System CDF for exponential parallel systemsF_sys_exp
Fit k-out-of-n system MLE under Scheme 1 (periodic inspection)fit_scheme1
MLE fitting for exponential k-out-of-n modelfit.exp_kofn
Fit Weibull k-out-of-n system modelfit.wei_kofn
Hessian of the log-likelihood for exponential k-out-of-n modelhess_loglik.exp_kofn
Hessian of log-likelihood for Weibull k-out-of-n systemhess_loglik.wei_kofn
Inclusion-exclusion expansion of a product of CDFsie_expand
Test if an object is a kofn modelis_kofn
Create a k-out-of-n system estimation modelkofn
Masked k-out-of-n log-likelihoodloglik_masked
Log-likelihood for Scheme 1 (periodic inspection) parallel systemloglik_scheme1
Log-likelihood for exponential k-out-of-n modelloglik.exp_kofn
Log-likelihood for Weibull k-out-of-n systemloglik.wei_kofn
Number of components in a kofn modelncomponents.kofn
Exact observation scheme (no censoring)observe_exact
Interval-censoring observation schemeobserve_interval_censor
Left-censoring observation schemeobserve_left_censor
Mixture of observation schemesobserve_mixture
Periodic inspection observation schemeobserve_periodic
Right-censoring observation schemeobserve_right_censor
Print method for kofn modelsprint.kofn
Generate masked k-out-of-n datardata_masked
Generate Scheme 1 (periodic inspection) datardata_scheme1
Random data generation for exponential k-out-of-n modelrdata.exp_kofn
Generate random data from a Weibull k-out-of-n systemrdata.wei_kofn
System survival function for exponential parallel systemsS_sys_exp
Score function for exponential k-out-of-n modelscore.exp_kofn
Score function for Weibull k-out-of-n systemscore.wei_kofn
Default MLE solver for positive parameterssolve_mle
Vectorized truncated log-moment of the Weibull distributiontrunc_log_moment_vec
Scalar truncated power moment of the Weibull distributiontrunc_pow_moment
Vectorized truncated power moment of the Weibull distributiontrunc_pow_moment_vec
Component weight for exponential parallel systemsw_j_exact
Closed-form integral of w_j(t) over an intervalw_j_integral