R/helper_nb.R

Defines functions .constrvec_nb .constrmat_nb

.constrmat_nb <- function(p) {
  mat <- array(0, c(p + 4, p + 2))
  mat[1:(p + 2), 1:(p + 2)] <- diag(1, p + 2)
  mat[p + 3, 1:p] <- (-1)
  mat[p + 4, p + 2] <- (-1)
  mat
}

.constrvec_nb <- function(p) {
  vec <- rep(0, p + 4)
  vec[(p + 3):(p + 4)] <- (-1)
  vec
}

Try the spINAR package in your browser

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

spINAR documentation built on May 29, 2024, 5:55 a.m.