BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_r2.hpp File Reference

Coefficient of determination, R^2. More...

#include "cl_Vector.hpp"
#include "cl_Matrix.hpp"
#include "fn_sum.hpp"
#include "fn_norm.hpp"
Include dependency graph for fn_r2.hpp:

Go to the source code of this file.

Namespaces

namespace  belfem
 USER GUIDES:

Functions

real belfem::r2 (const Vector< real > &aApproximated, const Vector< real > &aExact)
 calculates the R2 coefficient of determination from values of an evaluated function with respect to given samples.
real belfem::r2 (const Matrix< real > &aApproximated, const Matrix< real > &aExact)

Detailed Description

Coefficient of determination, R^2.

aExact is the reference data and aApproximated the values being judged against it; the two must have the same length. The helper returns exactly 1.0 when either the residual or the total variation falls below BELFEM_EPSILON, rather than dividing two near-zero numbers.