📄 gcvfctn.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -