R/marginalize.R

Defines functions marginalize

marginalize <-
function(members, beta, weights) {  
  w <- weights[members]/sum(weights[members])
  pvec <- colSums(beta[members,,drop=FALSE]*w)
  words <- order(pvec, decreasing=TRUE)
  return(list(beta=pvec, indices=words))
}

Try the stmCorrViz package in your browser

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

stmCorrViz documentation built on May 1, 2019, 8:03 p.m.