R/generate_Cplus.R

Defines functions generate_Cplus

generate_Cplus <- function(R,n){
  C <- generate_C(R,n)
  A <- matrix(1, nrow=1,ncol=R)
  E <- matrix(0, nrow=n,ncol=n*R)
  for(i in 1:n){
    E[i, (1+(i-1)*R):(R+(i-1)*R)] = A #put 1's for every T columns, row by row
  }

  C_tilde <- rbind(C, E)
  C_plus <- pinv(C_tilde) #computes the pseudoinverse

  return(C_plus)
}

Try the latentgraph package in your browser

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

latentgraph documentation built on Dec. 15, 2020, 5:23 p.m.