manualPlan: Create manual acceptance sampling (AS) plan from User Inputs

View source: R/manualPlan.R

manualPlanR Documentation

Create manual acceptance sampling (AS) plan from User Inputs

Description

Constructs an AttrPlan or VarPlan object from the given parameters.

Usage

manualPlan(distribution = c("binomial", "poisson", "normal", "beta"),
           n = NULL, c = NULL, k = NULL,
           USL = NULL, LSL = NULL, sigma = NULL, theta = NULL,
           sigma_type = c("known", "unknown"),
           theta_type = c("known", "unknown"),
           method = c("delta_mle", "delta_mom", "gk_adjustment",
                      "saddlepoint_mle", "saddlepoint_mom"))

Arguments

distribution

One of "binomial", "poisson", "normal", or "beta".

n

Sample size.

c

Acceptance number (for attribute sampling).

k

Acceptability constant (for variable sampling).

USL

Upper specification limit.

LSL

Lower specification limit.

sigma

Standard deviation (for normal plans).

theta

Precision parameter (for beta plans).

sigma_type

Either "known" or "unknown" (for normal).

theta_type

Either "known" or "unknown" (for beta).

method

Method used by an unknown-theta Beta plan. Delta–MLE is the default; alternatives are "delta_mom", "gk_adjustment", and experimental "saddlepoint_mle" or "saddlepoint_mom".

Details

The experimental "saddlepoint_mom" method uses the joint sample moments, the finite-integer-sample moment support, and the unchanged MOM inspection rule. Its numerical and finite-sample validation is incomplete: ordinary settings can be unsupported. Unsupported integrations or searches raise an error and do not return a substitute probability or plan. Population quadrature orders 128 and 256 and integration refinements must agree within 0.00002. A conservative log-concavity check on the tilted logit-integration kernel also rejects cases with unresolved remote tilted mass; rejected nodes are not omitted and renormalized. This numerical discrepancy is not a statistical risk bound. Integer plan searches check working risks and adjacent sizes; global minimality is not established. The method is slower than the Delta methods and caches successful and failed population calculations. The default remains "delta_mle".

This function provides a user-friendly wrapper to construct AS plan directly from parameters. Internally, it constructs the appropriate AttrPlan or VarPlan, from given paramenters. Delta–MLE requires finite n >= 2 and finite nonnegative k. Saddlepoint MLE additionally requires an integer inspection size. Supply explicit quality points pd when using OCdata() for a manual saddlepoint plan.

Value

An object of class "AttrPlan" or VarPlan.

Author(s)

Ha Truong

See Also

optPlan, OCdata

Examples

# Attribute sampling with user-defined parameters
plan1 <- manualPlan(n = 100, c = 2, distribution = "binomial")

# Variable sampling (normal)
plan2 <- manualPlan(n = 30, k = 1.5, distribution = "normal", USL = 10, sigma = 1)

# Unknown-theta Beta plan using analytical Delta--MoM
plan3 <- manualPlan(n = 45, k = 2.2, distribution = "beta",
                    theta = 300, theta_type = "unknown", method = "delta_mom",
                    USL = 0.05)


AccSamplingDesign documentation built on Nov. 12, 2026, 5:08 p.m.