KSPComputeConvergenceRate#

Compute the convergence rate for the iteration https:/en.wikipedia.org/wiki/Coefficient_of_determination

Synopsis#

#include "petscksp.h" 
#include "petscmat.h" 
PetscErrorCode KSPComputeConvergenceRate(KSP ksp, PetscReal *cr, PetscReal *rRsq, PetscReal *ce, PetscReal *eRsq)

Not Collective

Input Parameter#

  • ksp - The KSP

Output Parameters#

  • cr - The residual contraction rate

  • rRsq - The coefficient of determination, R2R^2, indicating the linearity of the data

  • ce - The error contraction rate

  • eRsq - The coefficient of determination, R2R^2, indicating the linearity of the data

Note#

Suppose that the residual is reduced linearly, rk=ckr0r_k = c^k r_0, which means logrk=logr0+klogclog r_k = log r_0 + k log c. After linear regression, the slope is logc\log c. The coefficient of determination is given by 1i(yif(xi))2i(yiyˉ)1 - \frac{\sum_i (y_i - f(x_i))^2}{\sum_i (y_i - \bar y)},

See Also#

KSP: Linear System Solvers, KSP, KSPConvergedRateView()

Level#

advanced

Location#

src/ksp/ksp/interface/itfunc.c


Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages