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 \mjseqnY can be expressed as \mjseqn\textAUC = W \cdot Y, with \mjseqnW defined by the following expressions for the trapezoid, the Lagrange and the spline interpolation methods.

Trapezoid method: \mjsdeqnW_j = \fract_j+1 - t_j2 \text if j=1 \mjsdeqnW_j = \fract_j - t_j-12 \text if j=m \mjsdeqnW_j = \fract_j+1 - t_j-12 \text otherwise

Lagrange method: (see AUC_Lagrange_Cjp_coefficients for the definition of the Cjp coefficients) \mjsdeqnW_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) \text if j=1,2,3 \mjsdeqnW_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) \text if j=m-2,m-1,m \mjsdeqnW_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) \text othermise

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

Value

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


marie-alexandre/AUCtest documentation built on Jan. 1, 2021, 8:31 a.m.