R/reconstruct.R

Defines functions reconstruct

Documented in reconstruct

reconstruct <- function(object)
{
  if (class(object)!="fitMisRepARMA") stop("Reconstruction should be done on a fitMisRepARMA object.")
  aux   <- attr(object, "z")
  q <- attr(object, "q")
  if (is.null(attr(object, "covars"))) 
  {
    x_rec <- ifelse(aux==0, object$data, object$data/q)
  }else{
    data2 <- object$data - attr(object, "covars")
    x_rec <- ifelse(aux==0, data2, data2/q) + attr(object, "covars")
  }
  return(x_rec)
}

Try the MisRepARMA package in your browser

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

MisRepARMA documentation built on July 14, 2021, 9:07 a.m.