| Title: | Dynamic Reinforcement Learning and Adaptive Progressive Censoring |
|---|---|
| Description: | Implements Maximum Likelihood Estimation (MLE) and Bayesian Markov Chain Monte Carlo (MCMC) sampling algorithms for progressive censoring models, with support for dynamic reinforcement learning environment simulation and accelerated computational routines written in C++. |
| Authors: | Okechukwu J. Obulezi [aut, cre] |
| Maintainer: | Okechukwu J. Obulezi <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.1 |
| Built: | 2026-10-11 13:06:46 UTC |
| Source: | https://github.com/cran/DRLAP2 |
Calculate Reward Signal
calc_reward(t_i, r_i, lambda = 0.5)calc_reward(t_i, r_i, lambda = 0.5)
t_i |
Observed failure time |
r_i |
Chosen removal action |
lambda |
Cost penalty scaling factor |
A numeric scalar representing the computed net reward signal (information gain minus action removal cost).
Computes internal sum terms S0, S1, and S2 used in DRL parameter estimation.
compute_drl_sums_cpp(t, R, beta)compute_drl_sums_cpp(t, R, beta)
t |
Numeric vector of positive time or survival values. |
R |
Numeric vector of response or censoring counts. |
beta |
Double specifying the beta shape parameter. |
A named list containing S0, S1, and S2.
t_vals <- c(1.2, 2.5, 3.1) R_vals <- c(0, 1, 0) compute_drl_sums_cpp(t = t_vals, R = R_vals, beta = 1.5)t_vals <- c(1.2, 2.5, 3.1) R_vals <- c(0, 1, 0) compute_drl_sums_cpp(t = t_vals, R = R_vals, beta = 1.5)
Evaluates the conditional log-target distribution for the beta parameter in DRL models.
drl_log_target_beta_cpp(beta, theta, t, R, a1, b1)drl_log_target_beta_cpp(beta, theta, t, R, a1, b1)
beta |
Double specifying the current beta parameter (must be positive). |
theta |
Double specifying the current theta scale parameter. |
t |
Numeric vector of positive time values. |
R |
Numeric vector of response counts. |
a1 |
Double specifying shape hyperparameter a1. |
b1 |
Double specifying rate hyperparameter b1. |
Double representing the evaluated log-target value.
t_vals <- c(1.2, 2.5, 3.1) R_vals <- c(0, 1, 0) drl_log_target_beta_cpp(beta = 1.5, theta = 0.8, t = t_vals, R = R_vals, a1 = 1.0, b1 = 1.0)t_vals <- c(1.2, 2.5, 3.1) R_vals <- c(0, 1, 0) drl_log_target_beta_cpp(beta = 1.5, theta = 0.8, t = t_vals, R = R_vals, a1 = 1.0, b1 = 1.0)
Bayesian MCMC Sampler for DRL-AP2 Weibull Model
fit_drl_bayes( t, R, priors = list(a1 = 0.1, b1 = 0.1, a2 = 0.1, b2 = 0.1), N_MC = 10000, N_burn = 2000, proposal_sd = 0.05 )fit_drl_bayes( t, R, priors = list(a1 = 0.1, b1 = 0.1, a2 = 0.1, b2 = 0.1), N_MC = 10000, N_burn = 2000, proposal_sd = 0.05 )
t |
Numeric vector of failure times |
R |
Numeric vector of removal actions |
priors |
List containing prior hyperparameters a1, b1, a2, b2 |
N_MC |
Total MCMC draws |
N_burn |
Burn-in draws to discard |
proposal_sd |
Standard deviation for Gaussian candidate proposal on beta |
An object of S3 class "drl_bayes", which is a list containing:
bayes_estimates |
A named numeric vector of posterior mean point estimates for parameters |
hpd_alpha |
A named numeric vector of length 2 giving the 95% equal-tailed credible interval limits for |
hpd_beta |
A named numeric vector of length 2 giving the 95% equal-tailed credible interval limits for |
chains |
A |
Maximum Likelihood Estimation for DRL-AP2 Weibull Model (C++ Accelerated)
fit_drl_mle(t, R, alpha = 0.05, max_iter = 100, tol = 1e-07)fit_drl_mle(t, R, alpha = 0.05, max_iter = 100, tol = 1e-07)
t |
Numeric vector of failure times |
R |
Numeric vector of progressive removal actions |
alpha |
Significance level (default = 0.05) |
max_iter |
Maximum Newton-Raphson iterations |
tol |
Convergence threshold |
A list containing point estimates and asymptotic confidence intervals
Initialize MDP State Observer for Dynamic Censoring
init_drl_env(n, m, budget)init_drl_env(n, m, budget)
n |
Total initial units at start of experiment |
m |
Required total number of failure observations |
budget |
Initial operational budget |
An object of class DRLState