get R square from data and fit function

R_square(data, ff, para, extra)

Arguments

data

numeric matrix. data[,1] gives \(x\) and data[,2] gives \(y\)

Value

numeric scalar. \(R^2\) (coefficient of determination) showing how well the function fits data

Examples

R_square(data1, f_protein, ideal.para11, extra11)
#> [1] 1
R_square(data1, f_protein, ideal.para11, extra12)
#> [1] 0.577768
R_square(data2, f_AI2_out, ideal.para2, extra2)
#> [1] 1