rspline: Random number generator with custom distribution

Description Usage Arguments Value

View source: R/spline_distribution.R

Description

Random numbers are taken from a distribution which is defined by control points. The control points should be an ordered vector of values which are asumed to be the vertical component of a curve in the range [-delta, 1 + delta]. So the first control point is the value at 'x = -delta' and the last control point contains the value at '1 + delta'. The other control points have an 'x' value located on equally spaced locations between these two 'x' values. Random draws from the distribution will be done by generating a random value between 0 and 1 and simulating the corresponding value a modelled by the control points. For modelling, splines are used.

Usage

1
rspline(n, control_points, seed, delta = 0)

Arguments

n

number of observations

control_points

values describing the ordered distribution

seed

single numeric to specify the seed

delta

Determines the range [-delta, 1 + delta] for the 'x' values of the control points.

Value

a vector of random numbers generated from the spline interpolated custom distribution.


fstpackage/syntheticbench documentation built on Jan. 23, 2020, 10:13 a.m.