1 | Tune_SSLasso(v0, tau, S, n, p_n, p)
|
v0 |
Tuning parameter v0 |
tau |
Tuning parameter tau, control on the diagonal |
S |
Sample covariance matrix |
n |
Sample size |
p_n |
Matrix dimension |
p |
The hyperparameter eta |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (v0, tau, S, n, p_n, p)
{
pb <- txtProgressBar(min = 0, max = length(v0) * 10 * length(tau),
style = 3)
bic = NULL
for (m in 1:length(p)) {
for (i in 1:length(v0)) {
v1 = seq(v0[i] + 0.1, 5 * v0[i], 0.5 * v0[i])
for (j in 1:length(v1)) {
for (k in 1:length(tau)) {
w = 1
l = 1
maxiter = 30
result1 <- EM_lasso(S, n, p_n, v0[i], v1[j],
maxiter, p[m], tau[k])
bic = rbind(bic, list(v0 = v0[i], v1 = v1[j],
tau = tau[k], p = p[m], BIC = BIC_SSLasso(result1$Theta,
S, result1$P, n)))
setTxtProgressBar(pb, (m - 1) * length(v0) *
length(v1) * length(tau) + (i - 1) * length(v1) *
length(tau) + (j - 1) * length(tau) + k)
}
}
}
}
close(pb)
return(bic[which.min(bic[, 5]), ])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.