R/XB.R

#' Computes a sociomatrix of regression effects
#' 
#' Computes a sociomatrix of regression effects
#' 
#' 
#' @param X an n x n x p array
#' @param b a p x 1 vector
#' @return an n x n matrix
#' @author Peter Hoff
#' @keywords multivariate models
"XB" <-
function(X,b) {

## generate sociomatrix of regression effects
  
  tmp<-matrix(0,nrow=dim(X)[1],ncol=dim(X)[2])
  for(k in seq(1,length(b),length=length(b))) { tmp<-tmp+b[k]*X[,,k] }
  tmp
                      }

Try the eigenmodel package in your browser

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

eigenmodel documentation built on May 28, 2019, 5:04 p.m.