R/make.adj.matrix.R

Defines functions make.adj.matrix

make.adj.matrix <-
function(theta, separate=FALSE)
{
	K = length(theta)
	adj = list()
	if(separate)
	{
		for(k in 1:K)
		{
			adj[[k]] = (abs(theta[[k]])>1e-5)*1
		}
	}
	if(!separate)
	{
		adj = 0*theta[[1]]
		for(k in 1:K)
		{
			adj = adj+(abs(theta[[k]])>1e-5)*2^(k-1)
		}
	}
return(adj)
}

Try the JGL package in your browser

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

JGL documentation built on May 29, 2017, 9:05 p.m.