R/SsmSamples-class.R

Defines functions validity.SsmSamples

#' @exportClass SsmSamples
NULL

#' @docType class
#' @aliases SsmSamples-class
#' @title Object containing state space model samples 
#'
#' @description Samples of observations and states generate from a state
#' space model. These objects are usually
#' generated by \code{\link{ssm_recursion}}.
#' 
#' The function \code{SsmSamples} is a generator function for
#' objects of this class.
#'
#' @param ... Data to include in the new object.
#' 
#' @section Slots:
#' \describe{
#' \item{\code{a}}{\code{Matrix} containing the latent states}
#' \item{\code{y}}{\code{Matrix} containing the observations}
#' }
#'
#' @docType class
#' @seealso \code{\link{ssm_samples}} which returns object of this class.
SsmSamples <-
  setClass("SsmSamples",
           representation =
           representation(a = "Matrix", y = "Matrix"))

validity.SsmSamples <- function(object) {
  if (ncol(object@a) != (ncol(object@y) + 1)) {
    return("ncol(object@a) != ncol(object@y) + 1d")
  }
  TRUE
}

setValidity("SsmSamples", validity.SsmSamples)
jrnold/yakf documentation built on May 20, 2019, 2:06 a.m.