R/utils.R

toSquare <- function (L.ut) 
{
  n <- (-1 + sqrt(1 + 8 * length(L.ut)))/2
  L <- 0 * diag(n)
  start <- 1
  for (irow in 1:n) {
    L[irow, ] <- c(rep(0, (irow - 1)), L.ut[start:(start + 
                                                     n - irow)])
    start <- start + n - irow + 1
  }
  return(L)
}

Try the symmoments package in your browser

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

symmoments documentation built on May 27, 2026, 9:06 a.m.