R/theta2Kh.R

Defines functions theta2Kh

Documented in theta2Kh

theta2Kh <- function(theta, mask, Dimnames){
	p <- dim(mask)[1]
	th_nm <- names(theta)
	Kh <- mask[upper.tri(mask, diag = TRUE)]
	id <- match(Kh, th_nm)
	Kh <- theta[id]
	if(any(is.na(Kh)))	Kh[is.na(Kh)] <- 0
	Kh <- new("dspMatrix", x = Kh, Dim = c(p, p), Dimnames = Dimnames)
	Kh
}

Try the sglasso package in your browser

Any scripts or data that you put into this service are public.

sglasso documentation built on Sept. 22, 2022, 5:06 p.m.