| Title: | Generate Optimal Designs of Accelerated Life Test using PSO-Based Algorithm |
|---|---|
| Description: | A computationally efficient solution for generating optimal experimental designs in Accelerated Life Testing (ALT). Leveraging a Particle Swarm Optimization (PSO)-based hybrid algorithm, the package identifies optimal test plans that minimize estimation variance under specified failure models and stress profiles. For more detailed, see Lee et al. (2025), Optimal Robust Strategies for Accelerated Life Tests and Fatigue Testing of Polymer Composite Materials <doi:10.1214/25-AOAS2075>. |
| Authors: | Hoai-Linh Hoang [aut, cre], I-Chen Lee [aut], Ping-Yang Chen [aut], Ray-Bing Chen [aut], Weng Kee Wong [aut] |
| Maintainer: | Hoai-Linh Hoang <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.4 |
| Built: | 2026-10-30 12:34:45 UTC |
| Source: | https://github.com/cran/minimaxALT |
Evaluates whether a design is optimal by the equivalence theorem.
check_optimality(best_design, model_set, design_info, seed = 42)check_optimality(best_design, model_set, design_info, seed = 42)
best_design |
A matrix containing stress levels and allocated proportion of the design, each row corresponds to stress levels of each factor, while the last row is their proportions. |
model_set |
A matrix of models, including parameters and distribution, that maximize the optimality criteria with the given best particle's position, each columns corresponds to model coefficients, while the last column is lifetime distribution. |
design_info |
A 'DesignInfo' object created by
function |
seed |
Seed for reproducibility |
An OptimalityCheck object containing optimality check results
Müller, C. H., & Pázman, A. (1998). Applications of necessary and sufficient conditions for maximin efficient designs. Metrika, 48, 1–19.
Huang, M.-N. L., & Lin, C.-S. (2006). Minimax and maximin efficient designs for estimating the location-shift parameter of parallel models with dual responses. Journal of Multivariate Analysis, 97(1), 198–210.
design_info <- set_design_info( k_levels=2, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) best_design <- rbind( c(0.682, 1), c(0.706, 0.294) ) model_set <- rbind( c(0.01, 0.9, "weibull"), c(0.01, 0.99, "lognormal") ) equi <- check_optimality ( best_design = best_design, model_set = model_set, design_info = design_info ) print(equi)design_info <- set_design_info( k_levels=2, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) best_design <- rbind( c(0.682, 1), c(0.706, 0.294) ) model_set <- rbind( c(0.01, 0.9, "weibull"), c(0.01, 0.99, "lognormal") ) equi <- check_optimality ( best_design = best_design, model_set = model_set, design_info = design_info ) print(equi)
Extract design from an OptimalALT object
extract_design(optimal_alt)extract_design(optimal_alt)
optimal_alt |
An object of class 'OptimalALT'. |
A matrix containing stress levels and allocated proportion of the design, each row corresponds to stress levels of each factor, while the last row is their proportions.
design_info <- set_design_info( k_levels=2, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.0001 ) example1_locally <- find_optimal_alt( design_type="locally", distribution="weibull", design_info=design_info, pso_info=pso_info, coef = c(0.001, 0.9), highest_level=TRUE, verbose=TRUE, n_threads = 1) opt_design <- extract_design(example1_locally)design_info <- set_design_info( k_levels=2, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.0001 ) example1_locally <- find_optimal_alt( design_type="locally", distribution="weibull", design_info=design_info, pso_info=pso_info, coef = c(0.001, 0.9), highest_level=TRUE, verbose=TRUE, n_threads = 1) opt_design <- extract_design(example1_locally)
Runs hybrid algorithm combining PSO and Nelder-Mead to find the optimal design of accelerated life test (ALT).
find_optimal_alt( design_type, distribution, design_info, pso_info, coef = NULL, coef_lower = NULL, coef_upper = NULL, init_values = NULL, highest_level = FALSE, n_threads = 1, verbose = TRUE, seed = 42 )find_optimal_alt( design_type, distribution, design_info, pso_info, coef = NULL, coef_lower = NULL, coef_upper = NULL, init_values = NULL, highest_level = FALSE, n_threads = 1, verbose = TRUE, seed = 42 )
design_type |
Character. One of c("locally", "minimax"). |
distribution |
Character. Failure distribution, one of c("weibull, "lognormal"). |
design_info |
A 'DesignInfo' object from |
pso_info |
A 'PSOInfo' object from |
coef |
Optional. Fixed model coefficients.
Required if |
coef_lower |
Optional. Lower bounds for model parameters.
Required if |
coef_upper |
Optional. Upper bounds for model parameters.
Required if |
init_values |
Optional. An 'InitialValue' object of initial values
from |
highest_level |
Logical. Whether the highest stress level of the
generated design is the upper bound of stress range |
n_threads |
Integer. Number of threads for parallel processing. |
verbose |
Logical. If |
seed |
Integer. Seed for reproducibility |
An object of class OptimalALT
Chen P (2024). _globpso: Particle Swarm Optimization Algorithms and Differential Evolution for Minimization Problems_. R package version 1.2.1, <https://github.com/PingYangChen/globpso>.
Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In Proceedings of the IEEE International Conference on Neural Networks (ICNN) (Vol. 4, pp. 1942–1948).
Lee, I. C., Chen, R. B., Wong, W. K., (in press). Optimal Robust Strategies for Accelerated Life Tests and Fatigue Testing of Polymer Composite Materials. Annals of Applied Statistics. <https://imstat.org/journals-and-publications/annals-of-applied-statistics/annals-of-applied-statistics-next-issues/>
Meeker, W. Q., & Escobar, L. A. (1998). Statistical methods for reliability data. New York: Wiley-Interscience.
Nelder, J. A. and Mead, R. (1965). A simplex algorithm for function minimization. Computer Journal, 7, 308–313. 10.1093/comjnl/7.4.308.
design_info <- set_design_info( k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.00001 ) res <- find_optimal_alt( design_type="minimax", distribution="lognormal", design_info=design_info, pso_info=pso_info, coef_lower=c(10^-6, 0.7), coef_upper=c(10^-3, 0.99), highest_level = TRUE, verbose = FALSE, n_threads = 1 ) print(res) summary(res) plot(res, x_l=0, x_h=1)design_info <- set_design_info( k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.00001 ) res <- find_optimal_alt( design_type="minimax", distribution="lognormal", design_info=design_info, pso_info=pso_info, coef_lower=c(10^-6, 0.7), coef_upper=c(10^-3, 0.99), highest_level = TRUE, verbose = FALSE, n_threads = 1 ) print(res) summary(res) plot(res, x_l=0, x_h=1)
Sets initial particles for PSO, initial locally optimal design, and initial parameters for Nelder-Mead algorithm.
initialize_values(init_swarm = NULL, init_local = NULL, init_coef_mat = NULL)initialize_values(init_swarm = NULL, init_local = NULL, init_coef_mat = NULL)
init_swarm |
Optional matrix of initial particle positions. If not
defined, particle positions are randomly generated using |
init_local |
Optional vector of initial locally optimal design for
Nelder-Mead optimization. If not defined, the initial vector representing
locally optimal design is |
init_coef_mat |
Optional matrix of initial parameters to implement
multi-start Nelder-Mead algorithm. The number of rows is the number of
starts, and each row is the corresponding initial parameters. If not defined,
the initial matrix of parameters is generated by sigmoid transformation of
|
An 'InitialValue' object of initialized values.
init_local <- c(1, 0.6, 0.3) init_coef_mat <- rbind( c(1e-6, 0.99), c(1e-2, 1), c(1.01e-6, 0.9999) ) j_factor <- 1 k_levels <- 3 n_swarm <- 32 d_swarm <- (j_factor + 1) * k_levels - 1 init_swarm <- matrix(runif(n_swarm*d_swarm), nrow=n_swarm, byrow=TRUE) init_values <- initialize_values( init_swarm=init_swarm, init_local=init_local, init_coef_mat=init_coef_mat )init_local <- c(1, 0.6, 0.3) init_coef_mat <- rbind( c(1e-6, 0.99), c(1e-2, 1), c(1.01e-6, 0.9999) ) j_factor <- 1 k_levels <- 3 n_swarm <- 32 d_swarm <- (j_factor + 1) * k_levels - 1 init_swarm <- matrix(runif(n_swarm*d_swarm), nrow=n_swarm, byrow=TRUE) init_values <- initialize_values( init_swarm=init_swarm, init_local=init_local, init_coef_mat=init_coef_mat )
Plot the verification of design optimality.
## S3 method for class 'OptimalALT' plot(x, x_l = 0, x_h = 1, nlevels = 10, ...)## S3 method for class 'OptimalALT' plot(x, x_l = 0, x_h = 1, nlevels = 10, ...)
x |
An object of class 'OptimalALT', typically returned by
|
x_l |
Numeric. Lower bound of the stress range. Default is |
x_h |
Numeric. Upper bound of the stress range. Default is |
nlevels |
Integer. Number of grid levels used for plotting the
optimality check for a two-factor design. Default is
|
... |
Additional arguments. |
Invisibly returns the original 'OptimalALT' object.
## Not run: # Suppose `result` is an OptimalALT object returned by find_optimal_alt(). plot(result) # Specify the stress range explicitly. plot(result, x_l = 0, x_h = 1) # For a two-factor design, increase the plotting grid resolution. plot(result, x_l = 0, x_h = 1, nlevels = 20) ## End(Not run)## Not run: # Suppose `result` is an OptimalALT object returned by find_optimal_alt(). plot(result) # Specify the stress range explicitly. plot(result, x_l = 0, x_h = 1) # For a two-factor design, increase the plotting grid resolution. plot(result, x_l = 0, x_h = 1, nlevels = 20) ## End(Not run)
Prints the design specifications stored in a DesignInfo object.
## S3 method for class 'DesignInfo' print(x, ...)## S3 method for class 'DesignInfo' print(x, ...)
x |
An object of class |
... |
Additional arguments. |
Invisibly returns the original DesignInfo object.
## Not run: design_info <- set_design_info(...) print(design_info) ## End(Not run)## Not run: design_info <- set_design_info(...) print(design_info) ## End(Not run)
Prints a concise summary of the initial values used for the PSO and Nelder-Mead optimization procedures.
## S3 method for class 'InitialValue' print(x, ...)## S3 method for class 'InitialValue' print(x, ...)
x |
An object of class |
... |
Additional arguments. |
Invisibly returns the InitialValue object.
## Not run: init_values <- initialize_values( init_swarm = init_swarm, init_local = init_local, init_coef = init_coef ) print(init_values) ## End(Not run)## Not run: init_values <- initialize_values( init_swarm = init_swarm, init_local = init_local, init_coef = init_coef ) print(init_values) ## End(Not run)
Prints a summary of the optimization results and optimality check
for an OptimalALT object.
## S3 method for class 'OptimalALT' print(x, ...)## S3 method for class 'OptimalALT' print(x, ...)
x |
An object of class |
... |
Additional arguments. |
Invisibly returns the original OptimalALT object.
## Not run: result <- find_optimal_alt(...) print(result) ## End(Not run)## Not run: result <- find_optimal_alt(...) print(result) ## End(Not run)
Prints the results of an optimality check for an accelerated life test (ALT) design.
## S3 method for class 'OptimalityCheck' print(x, show_candidates = FALSE, ...)## S3 method for class 'OptimalityCheck' print(x, show_candidates = FALSE, ...)
x |
An object of class |
show_candidates |
Logical. If |
... |
Additional arguments. |
Invisibly returns the original OptimalityCheck object.
## Not run: optimality <- check_optimality(...) print(optimality) ## End(Not run)## Not run: optimality <- check_optimality(...) print(optimality) ## End(Not run)
Prints the particle swarm optimization (PSO) hyperparameters stored
in a PSOInfo object.
## S3 method for class 'PSOInfo' print(x, ...)## S3 method for class 'PSOInfo' print(x, ...)
x |
An object of class |
... |
Additional arguments. |
Invisibly returns the original PSOInfo object.
## Not run: pso_info <- pso_setting(...) print(pso_info) ## End(Not run)## Not run: pso_info <- pso_setting(...) print(pso_info) ## End(Not run)
Define hyperparameters for particle swarm optimization (PSO).
pso_setting( n_swarm = 32, max_iter = 128, early_stopping = 10, tol = 0.01, c1 = 2.05, c2 = 2.05, w0 = 1.2, w1 = 0.2, w_var = 0.8, vk = 4 )pso_setting( n_swarm = 32, max_iter = 128, early_stopping = 10, tol = 0.01, c1 = 2.05, c2 = 2.05, w0 = 1.2, w1 = 0.2, w_var = 0.8, vk = 4 )
n_swarm |
Integer. Number of particles in the swarm. |
max_iter |
Integer. Maximum number of iterations. |
early_stopping |
Integer. The frequency, i.e. number of iterations, of validating the design optimality using equivalence theorem. The optimization process stops once maximum directional derivative is approximately 1. |
tol |
Numeric. Convergence tolerance. The algorithm stops if
|
c1 |
Numeric. Cognitive acceleration coefficient. Default value is 2.05. |
c2 |
Numeric. Social acceleration coefficient. Default value is 2.05. |
w0 |
Numeric. Starting inertia weight. Default value is 1.2. |
w1 |
Numeric. Ending inertia weight. Default value is 0.2. |
w_var |
Numeric. A number between |
vk |
Numeric. Velocity clamping factor. Default value is 4. |
A 'PSOInfo' object of PSO hyperparameters.
pso_info <- pso_setting(n_swarm=32, max_iter=128, early_stopping=10, tol=0.01)pso_info <- pso_setting(n_swarm=32, max_iter=128, early_stopping=10, tol=0.01)
Configures the settings for an accelerated life test.
set_design_info( k_levels, j_factor, n_unit, censor_time, p, use_cond, sigma, x_l = 0, x_h = 1, reparam = TRUE )set_design_info( k_levels, j_factor, n_unit, censor_time, p, use_cond, sigma, x_l = 0, x_h = 1, reparam = TRUE )
k_levels |
Integer. Number of stress levels. |
j_factor |
Integer. Number of stress factors. |
n_unit |
Integer. Total number of test units. |
censor_time |
Numeric. Test duration or censoring time. |
p |
Numeric. 0 < p < 1. Lifetime percentile to be estimated at the use condition, i.e. stress levels are 0. |
use_cond |
Vector. Stress levels at the use condition. |
sigma |
Numeric. Scale parameter of the lifetime distribution. |
x_l |
Numeric. Lower bound of stress range. Default is 0. |
x_h |
Numeric. Upper bound of stress range. Default is 1. |
reparam |
Logical. Whether reparameterization is applied to model
parameters. Reparameterization is supported for all design types, while
non-reparameterization is only available for locally optimal design
|
A 'DesignInfo' object of design specifications
design_info <- set_design_info(k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=c(0), sigma=0.6)design_info <- set_design_info(k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=c(0), sigma=0.6)
Provides a concise summary of the generated optimal accelerated life test (ALT) design and its optimality-check results.
## S3 method for class 'OptimalALT' summary(object, ...)## S3 method for class 'OptimalALT' summary(object, ...)
object |
An object of class |
... |
Additional arguments. |
Invisibly returns the original OptimalALT object.
## Not run: result <- find_optimal_alt(...) summary(result) ## End(Not run)## Not run: result <- find_optimal_alt(...) summary(result) ## End(Not run)
Update optimality check for an OptimalALT object
update_optimality_check(design, check)update_optimality_check(design, check)
design |
An object of class 'OptimalALT' |
check |
An object of class 'OptimalityCheck' |
An 'OptimalityALT' object with updated optimality check information
design_info <- set_design_info( k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6, x_l = 0.1, x_h = 1 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.0001 ) example1_lnorm_minimax <- find_optimal_alt( design_type="minimax", distribution="lognormal", design_info=design_info, pso_info=pso_info, coef_lower=c(10^-6, 0.7), coef_upper=c(10^-4, 0.9), highest_level = TRUE, verbose=TRUE, n_threads = 1) summary(example1_lnorm_minimax) opt_design <- extract_design(example1_lnorm_minimax) model_set <- rbind( c(10^-6, 0.99, "lognormal"), c(10^-4, 0.99, "lognormal") ) equi <- check_optimality ( best_design=opt_design, model_set=model_set, design_info=design_info ) opt_check_update_design <- update_optimality_check(example1_lnorm_minimax, equi) summary(opt_check_update_design)design_info <- set_design_info( k_levels=3, j_factor=1, n_unit=300, censor_time=183, p=0.1, use_cond=0, sigma=0.6, x_l = 0.1, x_h = 1 ) pso_info <- pso_setting( n_swarm=5, max_iter=10, early_stopping=5, tol=0.0001 ) example1_lnorm_minimax <- find_optimal_alt( design_type="minimax", distribution="lognormal", design_info=design_info, pso_info=pso_info, coef_lower=c(10^-6, 0.7), coef_upper=c(10^-4, 0.9), highest_level = TRUE, verbose=TRUE, n_threads = 1) summary(example1_lnorm_minimax) opt_design <- extract_design(example1_lnorm_minimax) model_set <- rbind( c(10^-6, 0.99, "lognormal"), c(10^-4, 0.99, "lognormal") ) equi <- check_optimality ( best_design=opt_design, model_set=model_set, design_info=design_info ) opt_check_update_design <- update_optimality_check(example1_lnorm_minimax, equi) summary(opt_check_update_design)