| nmfkc.kernel.beta.cv | R Documentation |
nmfkc.kernel.beta.cv selects the optimal beta parameter of the kernel function by applying cross-validation over a set of candidate values.
nmfkc.kernel.beta.cv(Y, rank = 2, U, V = NULL, beta = NULL, plot = TRUE, ...)
Y |
Observation matrix |
rank |
Rank of the basis matrix. |
U |
Covariate matrix |
V |
Covariate matrix |
beta |
A numeric vector of candidate kernel parameters to evaluate via cross-validation. |
plot |
Logical. If TRUE (default), plots the objective function values for each candidate |
... |
Additional arguments passed to |
A list with components:
beta |
The beta value that minimizes the cross-validation objective function. |
objfunc |
Objective function values for each candidate |
nmfkc.kernel.gaussian, nmfkc.kernel.beta.nearest.med,
nmfkc.kernel
# Example.
Y <- matrix(cars$dist,nrow=1)
U <- matrix(c(5,10,15,20,25),nrow=1)
V <- matrix(cars$speed,nrow=1)
nmfkc.kernel.beta.cv(Y,rank=1,U,V,beta=25:30/1000)
A <- nmfkc.kernel(U,V,beta=28/1000)
result <- nmfkc(Y,A,rank=1)
plot(as.vector(V),as.vector(Y))
lines(as.vector(V),as.vector(result$XB),col=2,lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.