Description Usage Arguments Value
View source: R/spline_distribution.R
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.
1 | rspline(n, control_points, seed, delta = 0)
|
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. |
a vector of random numbers generated from the spline interpolated custom distribution.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.