R/bootStateSpace-vec-2-mat-dot.R

Defines functions .Vec2Mat

.Vec2Mat <- function(x) {
  prefix <- unique(
    gsub("_\\d+_\\d+$", "", names(x))
  )
  output <- lapply(
    X = prefix,
    FUN = function(prefix) {
      if (
        prefix %in% c(
          "theta",
          "psi",
          "sigma",
          "sigma0"
        )
      ) {
        out <- .Vec2SymMat(
          x = x,
          prefix = prefix,
          row_names = NULL,
          col_names = NULL
        )
      } else {
        out <- .Vec2FullMat(
          x = x,
          prefix = prefix,
          row_names = NULL,
          col_names = NULL
        )
      }
      out
    }
  )
  names(output) <- prefix
  output
}

Try the bootStateSpace package in your browser

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

bootStateSpace documentation built on April 4, 2025, 1:35 a.m.