generate_copula | R Documentation |
Sample mixed data vector containing continuous, ordinal and binary data from a Gaussian copula model
generate_GC( n = 2000, var_types = NULL, cont_transform = NULL, cutoff_by = "quantile", qmin = 0.05, qmax = 0.95, num_ord = 5, corr = NULL, seed = NULL, data_only = TRUE ) generate_LRGC( rank = 5, sigma = 0.1, n = 2000, var_types = NULL, cont_transform = NULL, cutoff_by = "quantile", qmin = 0.05, qmax = 0.95, num_ord = 5, W = NULL, seed = NULL, data_only = TRUE )
n |
number of samples to draw |
var_types |
A list indicating the locations of continuous, ordinal and binary variables. The sum of its elements, |
cont_transform |
A monotonic function to be applied to continuous columns |
cutoff_by |
When ordinalizing, select cut points by absolute values if |
qmin |
Cutoff points are selected in the range of |
qmax |
See |
num_ord |
Number of ordinal levels to use |
corr |
Only used for |
seed |
random seed |
data_only |
If |
rank |
Only used for |
sigma |
Only used for |
W |
Only used for |
For generategc
, if corr
is NULL
, it will be allocated a random correlation matrix. For generate_lrgc
, if W
is NULL
, it will be allocated a random matrix. corr
used in LRGC is Wt(W)+sigma*I
. If corr
is a single correlation matrix, n
samples will be generated from the Gaussian copula model with corr
as the copula correlation. If corr
is a list of correlation matrices, for each element of corr
, n
samples will be generated from the Gaussian copula model with that element as its copula correlation.
generate_GC
: Generate samples from a full rank Gaussian copula
generate_LRGC
: Generate samples from a low rank Gaussian copula
generate_GC(n=500, var_types = list('cont'=1:5, 'ord'=6:10, 'bin'=11:15)) generate_GC(n=500, var_types = list('cont'=1:5, 'ord'=6:10), cont_transform=function(x)x^3) generate_GC(n=500, var_types = list('cont'=1:5, 'ord'=6:10), num_ord=3) f = function(x)x^3 generate_LRGC(rank = 5, sigma = 0.1, n = 500, var_types = list('cont'=1:99), cont_transform = f) generate_LRGC(rank = 5, sigma = 0.1, n = 500, var_types = list('ord'=1:99), num_ord = 10) generate_LRGC(rank = 5, sigma = 0.1, n = 500, var_types = list('bin'=1:99))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.