PWD_resi: Fit Rocke-Lorenzato profile model to residuals

View source: R/PWD_resi.r

PWD_resiR Documentation

Fit Rocke-Lorenzato profile model to residuals

Description

This routine fits the Rocke-Lorenzato precision profile model to the residuals from the fit (via PWD_inference).

Usage

PWD_resi(true, resi, epsilon=1e-5, printem=FALSE)

Arguments

true

the vector of values used to predict the precision – commonly X,

resi

the vector of residuals whose variance is thought to be a function of “true”,

epsilon

optional (default of 1e-5) - convergence tolerance limit,

printem

optional - if TRUE, routine will print out results as a message.

Details

The Rocke-Lorenzato precision profile model is

SD^2 = \sigma_r^2 + (\kappa_r\cdot true)^2

for the residuals from a precision-profile model fit.

Under this model, the approach for reviewing residuals is to fit a variance profile model to the residuals r_i themselves. This function includes a check for the special cases of

  • constant variance (\kappa_r=0) - in this case, one could switch to the simpler unweighted Deming model;

  • and of constant coefficient of variation (\sigma_r=0) - in this case, one could switch to the constant CV weighted Deming model.

using chi-squared tests.

Value

A list containing the following components:

sigmar

the estimate of \sigma_r

kappar

the estimate of \kappa_r

like

the likelihood

scalr

the scaled residuals

poolsig

the maximum likelihood estimate of \sigma_r if \kappa_r =0

poolkap

the maximum likelihood estimate of \kappa_r if \sigma_r =0

tests

the chi-squared test statistics for \kappa_r=0 and for \sigma_r=0

Pvals

the P values for the two chi-squared tests

Author(s)

Douglas M. Hawkins, Jessica J. Kraker krakerjj@uwec.edu

References

Hawkins DM and Kraker JJ. Precision Profile Weighted Deming Regression for Methods Comparison, on Arxiv (2025) doi:10.48550/arXiv.2508.02888

Hawkins DM (2014). A Model for Assay Precision. Statistics in Biopharmaceutical Research, 6, 263-269. http://dx.doi.org/10.1080/19466315.2014.899511

Examples

# library
library(ppwdeming)

# parameter specifications
sigma <- 1
kappa <- 0.08
alpha <- 1
beta  <- 1.1
true  <- 8*10^((0:99)/99)
truey <- alpha+beta*true
# simulate single sample - set seed for reproducibility
set.seed(1039)
# specifications for predicate method
X     <- sigma*rnorm(100)+true *(1+kappa*rnorm(100))
# specifications for test method
Y     <- sigma*rnorm(100)+truey*(1+kappa*rnorm(100))

# fit the model and store output
RL_gh_fit  <- PWD_get_gh(X,Y,printem=FALSE)
# run the residual analysis from the model output
post  <- PWD_resi(X, RL_gh_fit$resi, printem=TRUE)


ppwdeming documentation built on Sept. 9, 2025, 5:37 p.m.