View source: R/sim_rejection.R
sim_X | R Documentation |
Simulate initial X values
sim_X(n, fam_x, theta, offset, sim = TRUE)
n |
number of observations |
fam_x |
number for distribution family |
theta |
parameters for model |
offset |
optional mean correction |
sim |
should variables be simulated? |
Returns a list that includes a data frame containing a column
x
, as well as the density that was used to generate it. Possible
families are Gaussian (=1), t (=2), Exponential (=3), beta (=4)
Bernoulli/categorical (=5) and log-normal (=6).
For the exponential distribution, theta
is the mean.
Beta can take one or two parameters, and if there is only
one it is just repeated.
The offset
parameter alters the median for the normal and t-distributions,
or the median of the logarithm in the case of a log-normal.
A list with two entries: x
a vector of the simulated
values, and qden
, which contains a function that evaluates to the
density of the distribution used to generate those values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.