| PWD_get_gh | R Documentation |
This code estimates the variance profiles, assumed proportional, of the Rocke-Lorenzato form; also provides the resulting weighted Deming fit and residuals.
PWD_get_gh(X, Y, lambda = 1, rho=NA, alpha=NA, beta=NA, mu=NA,
epsilon = 1e-8, printem=FALSE)
X |
the vector of predicate readings. |
Y |
the vector of test readings. |
lambda |
optional (default of 1) - the ratio of the |
rho |
optional (default of NA) - numeric, single value or vector, initial estimate(s) of |
alpha |
optional (default of NA) - numeric, single value, initial estimate of |
beta |
optional (default of NA) - numeric, single value, initial estimate of |
mu |
optional (default of NA) - numeric, vector of length of |
epsilon |
optional (default of 1.e-8) - convergence tolerance limit. |
printem |
optional (default of FALSE) - if TRUE, routine will print out results as a |
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.
The search algorithm implements an efficient approach via reparameterization
to the ratio \rho = \frac{\sigma}{\kappa}.
If initial estimates are not provided, the parameters are initialized as:
alpha and beta are initially intercept and slope from simple linear regression;
rho is initialized as the vector c(0.01, 1, 100); and
mu is initialized as the values of X.
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 |
kappa |
the estimate of the Rocke-Lorenzato |
L |
the -2 log likelihood L |
Douglas M. Hawkins, Jessica J. Kraker krakerjj@uwec.edu
Hawkins DM and Kraker JJ (2026). Precision Profile Weighted Deming Regression for Methods Comparison. The Journal of Applied Laboratory Medicine, 11(2), 379-392. doi:10.1093/jalm/jfaf183
Rocke DM, Lorenzato S (2012). A Two-Component Model for Measurement Error in Analytical Chemistry. Technometrics, 37:2:176-184.
# 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), "\n")
# with estimated linear coefficients
cat("\nalphahat=", signif(RL_gh_fit$alpha,6),
"and betahat=", signif(RL_gh_fit$beta,6), "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.