rPiecewisePareto: Simulation of the Piecewise Pareto Distribution

View source: R/Functions.R

rPiecewiseParetoR Documentation

Simulation of the Piecewise Pareto Distribution

Description

Generates random deviates of a piecewise Pareto distribution

Usage

rPiecewisePareto(
  n,
  t,
  alpha,
  truncation = NULL,
  truncation_type = "lp",
  scale_pieces = NULL
)

Arguments

n

Numeric. Number of simulations

t

Numeric vector. Thresholds of the piecewise Pareto distribution.

alpha

Numeric vector. alpha[i] is the Pareto alpha in excess of t[i].

truncation

Numeric. If truncation is not NULL and truncation > t, then the distribution is truncated at truncation.

truncation_type

Character. If truncation_type = "wd" then the whole distribution is truncated. If truncation_type = "lp" then a truncated Pareto is used for the last piece.

scale_pieces

Numeric vector. If not NULL then the density of the i-th Pareto piece (on the interval (t[i], t[i+1])) is scaled with the factor const * scale_pieces[i] (where const is a normalization constant)

Value

A vector of n samples from the (truncated) piecewise Pareto distribution with parameter vectors t and alpha

Examples

t <- c(1000, 2000, 3000)
alpha <- c(1, 1.5, 2)
rPiecewisePareto(100, t, alpha)
rPiecewisePareto(100, t, alpha, truncation = 5000)
rPiecewisePareto(100, t, alpha, truncation = 5000, truncation_type = "lp")
rPiecewisePareto(100, t, alpha, truncation = 5000, truncation_type = "wd")


Pareto documentation built on April 18, 2023, 9:10 a.m.