Learn R Programming

FSMUMI (version 1.0)

compute.fa2: FA2

Description

Calculate the FA2 between two univariate signals Y (imputed values) and X (true values).

Usage

compute.fa2(Y, X, verbose = F)

Arguments

Y

vector of imputed values

X

vector of true values

verbose

if TRUE, print advice about the quality of the model

Details

This function returns the FA2 value which corresponds to the percentage of pairs of values (\(x_{i}, y_{i}\)) satisfying the condition \(0,5 <= (y_{i}/x_{i}) <= 2\). FA2 is close to 1, the imputation model is more accurate. Both vectors Y and X must be of equal length, on the contrary an error will be displayed. In both input vectors, eventual NA will be exluded with a warning diplayed.

Examples

Run this code
# NOT RUN {
data(dataFSMUMI)
X <- dataFSMUMI[, 1] ; Y <- dataFSMUMI[, 2]
compute.fa2(Y,X)
compute.fa2(Y,X, verbose = TRUE)

# By definition, if pairs of true and imputed values are zero,
# FA2 corresponding to this pair of values equals 1.
X[1] <- 0
Y[1] <- 0
compute.fa2(Y,X)
# }

Run the code above in your browser using DataLab