AUC_time_weights_estimation: Weights for AUC Matrix Formulation

Description Usage Arguments Details Value

View source: R/AUC_time_weights_estimation.R

Description

\loadmathjax

In matrix formulation, the area under a curve of interest, named Y, can be expressed as matrix product of a vector of weights W and the vector of the values of Y. This function calculates the weights W when AUC is calculated either by the trapezoid, the Lagrange or the Spline interpolation methods.

Usage

1

Arguments

time

a numerical vector of time points of length m (x-axis coordinates for AUC calculation).

method

a character scalar indicating the interpolation method of interest. Options are 'trapezoid', 'lagrange' and 'spline'. In this version the 'spline' interpolation method is implemented with the "not-a-knot" spline boundary conditions.

Details

In matrix formulation, the AUC of the outcome \mjteqnYYY can be expressed as \mjteqnAUC = W \cdot YAUC = W \cdot YAUC = W \cdot Y, with \mjteqnWWW defined by the following expressions for the trapezoid, the Lagrange and the spline interpolation methods.

Trapezoid method: \mjtdeqnW_j = \fract_j+1 - t_j2 \ if \ j=1W_j = \fract_j+1 - t_j2 \ if \ j=1W_j = \fract_j+1 - t_j2 \ if \ j=1 \mjtdeqnW_j = \fract_j - t_j-12 \ if \ j=mW_j = \fract_j - t_j-12 \ if \ j=mW_j = \fract_j - t_j-12 \ if \ j=m \mjtdeqnW_j = \fract_j+1 - t_j-12 \ otherwiseW_j = \fract_j+1 - t_j-12 \ otherwiseW_j = \fract_j+1 - t_j-12 \ otherwise

Lagrange method: (see AUC_Lagrange_Cjp_coefficients for the definition of the Cjp coefficients) \mjtdeqnW_j = \fracC_[2][j-1]\prod_l=0 ;\ l\neq (j-1)^P=2 (t_j-t_j+1) + \sum_p=0^P=3 \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=1,2,3W_j = \fracC_[2][j-1]\prod_l=0 ;\ l\neq (j-1)^P=2 (t_j-t_j+1) + \sum_p=0^P=3 \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=1,2,3W_j = \fracC_[2][j-1]\prod_l=0 ;\ l\neq (j-1)^P=2 (t_j-t_j+1) + \sum_p=0^P=3 \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=1,2,3 \mjtdeqnW_j = \fracC_[m][j-(m-2)]\prod_l=0 ;\ l\neq (j-(m-2))^P=2 (t_j-t_j-2+l) + \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=m-2,m-1,mW_j = \fracC_[m][j-(m-2)]\prod_l=0 ;\ l\neq (j-(m-2))^P=2 (t_j-t_j-2+l) + \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=m-2,m-1,mW_j = \fracC_[m][j-(m-2)]\prod_l=0 ;\ l\neq (j-(m-2))^P=2 (t_j-t_j-2+l) + \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ if \ j=m-2,m-1,m \mjtdeqnW_j = \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ otherwiseW_j = \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ otherwiseW_j = \sum_p=0^m-j \fracC_[j-1+p][3-p]\prod_l=0 ;\ l\neq (3-p)^P=3 (t_j-t_j-3+p+l) \ otherwise

Spline method: (see AUC_Spline_matrix_A and AUC_Spline_matrix_B for the definition of Matrices A and B) \mjtdeqnW_j = \sum_p=2^m -\frac(t_p-t_p-1)^324(u_pj+u_p-1j) + W_j^trap.W_j = \sum_p=2^m -\frac(t_p-t_p-1)^324(u_pj+u_p-1j) + W_j^trap.W_j = \sum_p=2^m -\frac(t_p-t_p-1)^324(u_pj+u_p-1j) + W_j^trap. where \mjteqn(u_pj)(u_pj)(u_pj) is the element \mjteqnU(p,j)U(p,j)U(p,j) with \mjteqnUUU a matrix defined as \mjteqnU = A^-1BU = A^-1BU = A^-1B.

Value

A numerical scalar with same length than the vector time corresponding to the weights W.


marie-alexandre/AUCcomparison documentation built on Dec. 21, 2021, 1:52 p.m.