gcval | R Documentation |
Extract the smallest regularization parameter.
gcval(U, s, b, npoints)
U |
U matrix from gsvd(G, L) |
s |
[diag(C) diag(S)] which are the lambdas and mus from the gsvd |
b |
the data to try and match |
npoints |
number of alphas to estimate |
Evaluate the GCV function gcv_function at npoints points.
List:
reg_min |
alpha with the minimal g (scalar) |
g |
|| Gm_(alpha,L) - d ||^2 / (Tr(I - GG#)^2 |
alpha |
alpha for the corresponding g |
Jonathan M. Lees<jonathan.lees@unc.edu>
gcv_function
set.seed(2015)
VSP = vspprofile()
t = VSP$t2
G = VSP$G
M = VSP$M
N = VSP$N
L1 = get_l_rough(N,1);
littleU = PEIP::GSVD(as.matrix(G), as.matrix(L1) );
BIGU = flipGSVD(littleU, dim(G), dim(L1) )
U1 = BIGU$U
V1 =BIGU$V
X1=BIGU$X
Lam1=BIGU$C
M1=BIGU$S
lam=sqrt(diag(t(Lam1 %*% Lam1)));
mu=sqrt(diag(t(M1)%*%M1));
p=rnk(L1);
sm1=cbind(lam[1:p],mu[1:p])
### % get the gcv values varying alpha
###
ngcvpoints=1000;
HI = gcval(U1,sm1,t,ngcvpoints);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.