R/getV.R

Defines functions getV

#' Build the observation covariance matrix for Predictive Dynamic Linear Models (pdlm)
#'
#'
#' @param x model parameters
#' @param k the dimension of observation equation
#'
#' @return A matrix with proper dimension.
#'
#' @noRd
#'
getV <- function(x, k){

  if(length(x)==2){
    V <- c(x[1], rep(x[2], k-1))#c(x[1], rep(x[2], k-1))
  }else{
    V <- x
  }
  V <- diag(V, nrow=k)
  return(V)
}

Try the dlmwwbe package in your browser

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

dlmwwbe documentation built on June 8, 2025, 10:07 a.m.