R/scenario_methods.R

Defines functions get_sigma_list get_sigma_list get_ellipsoids.fars_scenario get_ellipsoids

Documented in get_ellipsoids get_ellipsoids.fars_scenario get_sigma_list

#' @title Generic Function to Extract Ellipsoids
#'
#' @param x An object from which to extract the ellipsoids
#' @param ... Additional arguments.
#'
#' @return A list of matrices defining the ellipsoids at each time.
#' @export
get_ellipsoids <- function(x, ...) {
  UseMethod("get_ellipsoids")
}


#' @title Get Ellipsoids from a \code{fars_scenario} Object.
#'
#' @description Returns the list of ellipsoids from a \code{fars_scenario} object.
#'
#' @param x An object of class \code{fars_scenario}.
#' @param ... Additional arguments (ignored).
#' 
#' @return A list of matrices defining the ellipsoids at each time.
#' @export
get_ellipsoids.fars_scenario <- function(x, ...) {
  x$ellipsoids
}


#' @title Generic Function to Get Sigma List
#'
#' @param x An object from which to extract the sigma list.
#' @param ... Additional arguments.
#'
#' @return A list of covariance matrices.
#' @export
get_sigma_list <- function(x, ...) {
  UseMethod("get_sigma_list")
}


#' @title Extract Sigma List from \code{fars_scenario}
#'
#' @description Returns the list of covariance matrices used to construct the ellipsoids.
#'
#' @param x An object of class \code{fars_scenario}.
#' @param ... Additional arguments (ignored).
#' 
#' @return A list of covariance matrices (one per period).
#' @export
get_sigma_list <- function(x, ...) {
  x$sigma
}

Try the FARS package in your browser

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

FARS documentation built on Feb. 17, 2026, 5:06 p.m.