extrapolate_rate computes the extrapolation rate given the test signal (maxed out), the true complete signal (no maxed out) and the extrapolated signal.

extrapolate_rate(test_df, true_df, extrap_df)

## Arguments

test_df dataframe. See details for the input format. dataframe. See details for the input format. dataframe. See details for the input format.

## Value

number. The extrapolation rate value in double format. If extrapolation rate is 1, it means the extrapolated signal recovers as the true signal. If extrapolation rate is between 0 and 1, it means the extrapolation helps reducing the errors caused by signal maxing out. If extrapolation rate is smaller than 0, it means the extrapolation increases the errors caused by signal maxing out (during over extrapolation).

## Details

All three input dataframes will have the same format, with the first column being timestamps in POSXlct format, and the following columns being acceleration values in g.

## How is it used in MIMS-unit algorithm?

This function is used to compute extrapolation rate during extrapolation parameter optimization. You may see results in Figure 2 of the manuscript.

Other extrapolation related functions: extrapolate()

## Examples

  # Prepare data for test, ground truth
test_df = conceptual_diagram_data[
conceptual_diagram_data['GRANGE'] == 4,
extrapolate_rate(test_df, true_df, extrap_df)#> [1] 0.7947812