Package: kofn 0.4.0

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.zip(r-4.7-any)kofn_0.4.0.zip(r-4.6-any)kofn_0.4.0.zip(r-4.5-any)
kofn_0.4.0.tgz(r-4.6-any)kofn_0.4.0.tgz(r-4.5-any)
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✨
DESCRIPTION |NEWS
card.svg |card.png
kofn/json (API)

# Install 'kofn' in R:
install.packages('kofn', repos = c('https://queelius.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:

5.50 score 9 scripts 236 downloads 32 exports 12 dependencies

Last updated from:e43e2f4003. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK168
source / vignettesOK347
linux-releaseOK183
macos-releaseOK153
macos-oldrelOK156
windows-develOK144
windows-releaseOK202
windows-oldrelOK151
wasm-releaseOK99

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
Two packages, two missions | What kofn delegates to dist.structure | When you might invoke dist.structure directly | Convention conversion | Migration notes: v0.2.0 -> v0.3.0 | Why this architecture

Last update: 2026-05-23
Started: 2026-04-15

Exponential Parallel Systems: Closed-Form MLE via Inclusion-Exclusion
The Exponential Parallel System | Inclusion-Exclusion Expansion | Likelihood Under Different Observation Types | Maximum Likelihood Estimation | Data generation | Fitting | Comparison with true values | Permutation Symmetry | Monte Carlo Validation | Results | Observation Functors | Scheme 0: System lifetime with right-censoring | Effect of censoring on estimation | Scheme 1: Periodic inspection

Last update: 2026-05-23
Started: 2026-03-14

Getting started with kofn
What kofn does | Your first fit | Convention | Observation schemes | Weibull components | Periodic inspection (Scheme 1) | Masked cause-of-failure | Fisher information comparison | What's next

Last update: 2026-05-23
Started: 2026-04-15

Inside kofn: Building on the rlang MLE Stack
The design in one paragraph | The stack | A running example | Layer 1: the likelihood calculus (likelihood.model) | Layer 2: the optimizer (compositional.mle) | Layer 3: the MLE object (algebraic.mle) | Layer 4: the distribution bridge (algebraic.dist) | What had to be specialized | Extending the stack | Further reading

Last update: 2026-05-23
Started: 2026-04-14

Observation Scheme Composability
The Observe Functor API | Composing Schemes with rdata | Effect on Estimation | Mixed Observation Environments

Last update: 2026-05-23
Started: 2026-03-24

Observation Schemes: Resolving Information Asymmetry via Periodic Inspection
Introduction | 1. The observation scheme hierarchy | 2. The information asymmetry problem | 3. Scheme 1: Periodic inspection | The likelihood | 4. Scheme 0 vs Scheme 1 comparison | Monte Carlo comparison | 5. Sensitivity to inspection interval width | 6. Information-theoretic interpretation | 7. Fisher information comparison | 8. Scheme 1 across the k-spectrum | 9. Practical guidelines

Last update: 2026-05-23
Started: 2026-03-14

Weibull Parallel Systems: EM Algorithm for Shape-Scale Estimation
Why Weibull? | What breaks: from exponential to Weibull | Direct MLE struggles | The EM algorithm | E-step: classification and truncated moments | M-step: profile optimization | EM vs direct MLE comparison | Shape effect on estimation difficulty | Mixed shapes: DFR + IFR systems | Base R stats integration | Summary

Last update: 2026-05-23
Started: 2026-03-14

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