var_explained: Sum-of-squares values showing what portion of variance in...

Description Usage Arguments Value

View source: R/common_tools.R

Description

Computation as in: http://en.wikipedia.org/wiki/Fraction_of_variance_unexplained

ss_est becomes zero if dvec_est equals dvec_0=rep(mean(dvec),length(dvec)). If dvec_est is better estimate than dvec_0, R2 is positive. If dvec_est is worse than dvec_0, R2 is negative.

Usage

1
var_explained(dvec, dvec_est)

Arguments

dvec

[1,m] numeric, data vector

dvec_est

[1,m] numeric, data vector, an estimate of dvec

Value

A list with elements:

ss_tot:

Sum of squares in dvec

ss_est:

Sum of squares in dvec_est

ss_err:

Sum of squares of dvec - dvec_est

R2:

Percentage of variance explained i.e. 1 - ss_err/ss_tot


cocoreg documentation built on May 31, 2017, 5:18 a.m.