fit = goodnessOfFit(x,xref,cost_func) returns
the goodness of fit between the data, x, and
the reference, xref using a cost function specified
by cost_func.

Input Arguments

x

Test data.

x is an Ns-by-N matrix,
where Ns is the number of samples and N is
the number of channels.

x can also be a cell array of multiple
test data sets.

xref can also be a cell array of multiple
reference sets. In this case, each individual reference set must be
of the same size as the corresponding test data set.

xref must not contain any NaN or Inf values.

cost_func

Cost function to determine goodness of fit.

cost_func must be one of the following
strings:

'MSE' — Mean square error:

where, ‖ indicates the 2-norm of a vector. fit is a scalar value.

'NRMSE' — Normalized root
mean square error:

where, ‖ indicates the 2-norm of a vector. fit is a row vector of length N and i
= 1,...,N, where N is the number of channels.

NRMSE costs vary between -Inf (bad fit) to
1 (perfect fit). If the cost function is equal to zero, then x is
no better than a straight line at matching xref.

'NMSE' — Normalized mean
square error:

where, ‖ indicates the 2-norm of a vector. fit is a row vector of length N and i
= 1,...,N, where N is the number of channels.

NMSE costs vary between -Inf (bad fit) to
1 (perfect fit). If the cost function is equal to zero, then x is
no better than a straight line at matching xref.

Output Arguments

fit

Goodness of fit between test and reference data.

For a single test data set and reference pair, fit is returned as a: