gcvfctn.m

来自「GCV Generalized cross-validation.广义交叉校验,」· M 代码 · 共 23 行

M
23
字号
function G = gcvfctn(h, s2, fc, rss0, dof0)
%GCVFCTN    Evaluate generalized cross-validation function.
%
%    gcvfctn(h, s2, fc, rss0, dof0) is the value of the GCV function
%    for ridge regression with regularization parameter h. The other
%    input arguments are the squared singular values s2 of the design
%    matrix; the coefficients fc = U(:, 1:q)'*g, where U is the matrix
%    of left singular vectors, g is a vector of response variables,
%    and q = min(n,p) is the smaller of the numbers of rows and
%    columns of the design matrix; the residual sum of squares of
%    the (non-regularized) least squares estimate; and the number
%    of residual degrees of freedom of the (non-regularized) least
%    squares estimate.
%
%    Auxiliary function for GCV.

%    Adapted from GCVFUN in Per-Christian Hansen's Regularization
%    Toolbox.

  f      = h^2 ./ (s2 + h^2);
  G      = (norm(f.*fc)^2 + rss0) / (dof0 + sum(f))^2;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?