Linear Deming Regression
[ b sigma2_x x_est y_est stats] = deming(x,y,lambda,alpha)
deming() performs a linear Deming regression to find the linear coefficients:
y = b(1) + b(2)*x
under the assumptions that x and y *both* contain measurement error with measurement error variance related as lambda = sigma2_y/sigma2_x (sigma2_x and sigma2_y is the measurement error variance of the x and y variables, respectively).
Computations are performed as described by Anders Christian Jenson in a May 2007 description of the Deming regression function for MethComp (web: http://staff.pubhealth.ku.dk/~bxc/MethComp/Deming.pdf), which includes a nice derivation of the slope, intercept, variance, and (x,y) estimates.
Inputs:
x - [Nx1] Measured data w/ error
y - [Nx1] Measured data w/ error
lambda - [1x1] [OPTIONAL] Relationship between measurement error expressed as ratio: sigma2_y / sigma2_x (default = 1)
alpha - [1x1] [OPTIONAL] Confidence level (default = 0.05)
Outputs:
b - [2x1] Intercept (1) and slope (2)
sigma2_x - [1x1] Error variance. Note: sigma2_y = lambda*sigma2_x
x_est - [Nx1] Estimated x values
y_est - [Nx1] Estimated y values
stats - [STR] Additional statistical information
.s_e - Standard error of regression estimate
.s_b - Jacknife estimate of the standard error of the slope and intercept
.t_c - *Critical t-value used for confidence intervals
.b_ci - *Confidence interval for slope and intercept
*stats.b_ci and stats.t_c are only available if the statistics package is installed and/or the tinv function is available.
Example is available by typing "help deming" at the command line.