R/getIdParameterMapping.R

Defines functions getIdParameterMapping

# returns a table with a list of node ids and corresponding parameter estimates
getIdParameterMapping <-
function(tree)
{
	v <- cbind(tree$node_id, t(tree$params));
	
	if (tree$caption == "TERMINAL")
	{
		return(v);
	}
	

	r <- getIdParameterMapping(tree$right_child);
	l <- getIdParameterMapping(tree$left_child);
	#print(toString(tree$params))
	return(rbind(v,r,l));
	
}

Try the semtree package in your browser

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

semtree documentation built on May 29, 2024, 4:05 a.m.