families: Family classes for a Xy simulation recipe

familiesR Documentation

Family classes for a Xy simulation recipe

Description

These gathered list of family objects let you alter the distributional family of a simulated variable. They are invoked within the effect generating functions add_effects. The families are using the stats functions corresponding to the distributional family, i.e. for the normal distribution pnorm.

Usage

xy_beta(shape1 = 3, shape2 = 1, ncp = 0)

xy_binom(size = 2, prob = 0.1)

xy_cauchy(location = 0, scale = 1)

xy_chisq(df = 3, ncp = 0)

xy_exp(rate = 1)

xy_f(df1 = 1, df2 = 2, ncp = 0)

xy_gamma(shape = 1, rate = 2, scale = 1/rate)

xy_geometric(prob = 0.5)

xy_hypergeometric(m = 10, n = 7, k = 8)

xy_logistic(location = 0, scale = 1)

xy_lognormal(meanlog = 0, sdlog = 1)

xy_normal(mean = 0, sd = 3)

xy_poisson(lambda = 1)

xy_signrank(n = 5)

xy_t(df = 1, ncp = 0)

xy_uniform(min = 0, max = 1)

xy_weibull(shape = 1, scale = 1)

xy_wilcox(m = 4, n = 6)

Arguments

shape1

a single non-negative parameter (see pbeta)

shape2

a single non-negative parameter (see pbeta)

ncp

a non-centrality parameter (e.g. see pbinom)

size

a single number of trials (see pbinom)

prob

a single probability (see pbinom, pgeom)

location

a single location parameter (see pcauchy, plogis)

scale

a single scale parameter (see pgamma)

df

a single integer specifying the degrees of freedom (see pchisq, pt)

rate

a single non-negative rate parameter (see pexp, pgamma)

df1

a single integer specifying the degrees of freedom (see pf)

df2

a single integer specifying the degrees of freedom (see pf)

shape

a single shape parameter (see pgamma, pweibull)

m

the number of observations in the first sample (see phyper, pwilcox)

n

the number of observations in the second sample (see phyper, pwilcox, psignrank)

k

the number of observations drawn from the sample (see phyper)

meanlog

a single numeric location parameter (see plnorm)

sdlog

a single numeric scale parameter (see plnorm)

mean

a single numeric location parameter (see pnorm)

sd

a single numeric scale parameter (see pnorm)

lambda

a single numeric value of means (see ppois)

min

a single numeric value specifying the lower bound (see punif)

max

a single numeric value specifying the upper bound (see punif)

Value

a tibble with information on the distributional properties. This information is only used internally forwarded to the copula simulation.

Examples

# build a simulation recipe with linear features from the cauchy distribution
xy_recipe <- Xy(task = "regression") %>%
  # add linear features with the desired distribution
  add_linear(p = 5, family = xy_cauchy(location = 0, scale = 3))

# build a simulation recipe with squared nonlinear features from the normal distribution
xy_recipe <- Xy(task = "regression") %>%
  # add nonlinear features with the desired distribution
  add_nonlinear(
    p = 5, nlfun = function(x) x^2,
    family = xy_normal(mean = 0, sd = 3)
  )

andrebleier/Xy documentation built on March 29, 2023, 12:41 p.m.