getDistribution: Get the Distribution of a Series

View source: R/analyzeSim.r

getDistributionR Documentation

Get the Distribution of a Series

Description

Intended to produce summary statistics for series in the simulation such as rateOfReturns, agesDeath1 and such. The geometric average makes sense to include for rateOfReturn and inflation, but not for ages. If isReturnSeries == TRUE, the returns and standard deviation will be showin in percent, not decimal.

Usage

getDistribution(
  x,
  probs = c(0, 0.05, 0.25, 0.5, 0.75, 0.95, 1),
  isReturnSeries = FALSE
)

Arguments

x

Series for which to get the distribution

probs

numeric vector of probabilities with values in [0, 1]

isReturnSeries

boolean if a return series. Will include geometric average and subtract 1 from the probs and summary items.

Value

list with nObs - the number of observations; probs - the quanitles associated with the probs; summary - results of the summary function; sd - the (standard deviation); and, geomAvg the geometric average if isReturnSeries is TRUE

Examples

## Not run: getDistribution(unlist(sim$simulation$rateOfReturns) - 1,
includeGeomAvg = TRUE)
## End(Not run)

rexmacey/aasim documentation built on Oct. 29, 2024, 9:30 a.m.