PWD_get_gh: Estimate of Variance Profile Functions (proportional)

View source: R/PWD_get_gh.r

PWD_get_ghR Documentation

Estimate of Variance Profile Functions (proportional)

Description

This code estimates the variance profiles, assumed proportional, of the Rocke-Lorenzato form; also provides the resulting weighted Deming fit and residuals.

Usage

PWD_get_gh(X, Y, lambda=1, epsilon=1.e-8, printem=FALSE)

Arguments

X

the vector of predicate readings,

Y

the vector of test readings,

lambda

optional (default of 1) - the ratio of the X to the Y precision profile (defaults to 1),

epsilon

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

printem

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

Details

This workhorse routine optimizes the likelihood in the unknown g, h setting over its n+4 parameters (the two Rocke-Lorenzato precision profile parameters \sigma and \kappa, the intercept \alpha and slope \beta, and the n latent true concentrations \mu_i).

That is, the assumed forms are:

  • predicate precision profile model: g_i = var(X_i) = \lambda\left(\sigma^2 + \left[\kappa\cdot \mu_i\right]^2\right) and

  • test precision profile model: h_i = var(Y_i) = \sigma^2 + \left[\kappa\cdot (\alpha + \beta\mu_i)\right]^2.

Value

A list containing the following components:

alpha

the fitted intercept

beta

the fitted slope

fity

the vector of predicted Y

mu

the vector of estimated latent true values

resi

the vector of residuals

sigma

the estimate of the Rocke-Lorenzato \sigma

kappa

the estimate of the Rocke-Lorenzato \kappa

like

the -2 log likelihood L

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

Rocke DM, Lorenzato S (2012). A Two-Component Model for Measurement Error in Analytical Chemistry. Technometrics, 37:2:176-184.

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 with RL precision profile to estimate parameters
RL_gh_fit  <- PWD_get_gh(X,Y,printem=TRUE)
# RL precision profile estimated parameters
cat("\nsigmahat=", signif(RL_gh_fit$sigma,6),
    "and kappahat=", signif(RL_gh_fit$kappa,6))


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