MyNixOS website logo
Description

Likelihood Models for Systems with Masked Component Cause of Failure.

Maximum likelihood estimation for series systems where the component cause of failure is masked. Implements analytical log-likelihood, score, and Hessian functions for exponential, homogeneous Weibull, and heterogeneous Weibull component lifetimes under masked cause conditions (C1, C2, C3). Supports exact, right-censored, left-censored, and interval-censored observations via composable observation functors. Provides random data generation, model fitting, and Fisher information for asymptotic inference. See Lin, Loh, and Bai (1993) <doi:10.1109/24.257799> and Craiu and Reiser (2006) <doi:10.1111/j.1541-0420.2005.00498.x>.

maskedcauses

R-universe License: GPL v3

Maximum likelihood estimation for series system parameters from masked component failure data. Supports exact, right-censored, left-censored, and interval-censored observations with composable observation schemes.

Installation

From r-universe:

install.packages("maskedcauses",
                 repos = "https://queelius.r-universe.dev")

Or from GitHub:

# install.packages("devtools")
devtools::install_github("queelius/maskedcauses")

Models

Three likelihood models, all using S3 generic dispatch:

ModelParametersDescription
exp_series_md_c1_c2_c3m rates: (λ₁, ..., λₘ)Exponential components. Closed-form loglik, score, and Hessian for all four observation types.
wei_series_homogeneous_md_c1_c2_c3m+1: (k, β₁, ..., βₘ)Weibull with shared shape. Closed-form loglik; hybrid analytical/numerical score.
wei_series_md_c1_c2_c32m: (k₁, β₁, ..., kₘ, βₘ)Weibull with per-component shapes. Numerical integration for left/interval types.

Each model implements S3 methods for: loglik(), score(), hess_loglik(), rdata(), assumptions(), component_hazard(), cause_probability(), conditional_cause_probability(), ncomponents()

Quick Start

library(maskedcauses)

# Create model and generate data
model <- exp_series_md_c1_c2_c3()
gen <- rdata(model)
df <- gen(theta = c(1.0, 1.1, 0.95), n = 500, tau = 3, p = 0.3)

# Fit via MLE
solver <- fit(model)
mle <- solver(df, par = c(1, 1, 1))
mle$theta.hat   # estimated rates
mle$sigma       # asymptotic standard errors

# Evaluate likelihood functions at the MLE
loglik(model)(df, par = mle$theta.hat)
score(model)(df, par = mle$theta.hat)
hess_loglik(model)(df, par = mle$theta.hat)

Observation Types

The package supports four observation types via composable observation functors that separate the observation mechanism from the data-generating process:

TypeColumn omegaDescription
Exact"exact"Failure time observed precisely
Right-censored"right"System survived past observation time
Left-censored"left"System failed before inspection time
Interval-censored"interval"Failure occurred in window [t, t_upper]
# Right-censoring at tau (default, backwards-compatible)
df <- gen(theta, n = 500, tau = 5, p = 0.3)

# Periodic inspection every 0.5 time units
df <- gen(theta, n = 500, p = 0.3,
          observe = observe_periodic(delta = 0.5, tau = 5))

# Mixed monitoring: 60% continuous, 20% single inspection, 20% periodic
df <- gen(theta, n = 500, p = 0.3,
          observe = observe_mixture(
            observe_right_censor(tau = 5),
            observe_left_censor(tau = 3),
            observe_periodic(delta = 0.5, tau = 5),
            weights = c(0.6, 0.2, 0.2)
          ))

Masking Conditions

The candidate set models satisfy three conditions (C1, C2, C3) that yield a reduced likelihood depending only on observed data:

  • C1: The failed component is always in the candidate set
  • C2: Candidate set probabilities are symmetric across components in the set
  • C3: Masking probabilities are independent of system parameters

Data Format

ColumnDescription
tSystem lifetime (observed)
omegaObservation type: "exact", "right", "left", or "interval"
t_upperUpper bound for interval-censored observations (NA otherwise)
x1, x2, ..., xmBoolean candidate set indicators

For backwards compatibility, a delta column (TRUE/FALSE) is also accepted in place of omega for exact/right-censored data.

Vignettes

Four tutorial vignettes with worked examples and Monte Carlo studies:

vignette("exponential_series", package = "maskedcauses")
vignette("weibull_homogeneous_series", package = "maskedcauses")
vignette("weibull_series", package = "maskedcauses")
vignette("censoring_comparison", package = "maskedcauses")

Browse online at https://queelius.github.io/maskedcauses/articles/.

Related Packages

License

GPL (>= 3)

Metadata

Version

0.10.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows