gen_zero_dat: Generates a sample zero-inflated data matrix.

Description Usage Arguments Details Value Examples

View source: R/zero_gen.R

Description

Generates a sample zero-inflated data matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gen_zero_dat(
  seed,
  gen_para,
  adj_mat,
  n,
  k_mode = 1,
  min_num = 10,
  therun = 1,
  gen_uniform_degree = 1
)

Arguments

seed

A number, the seed passed to set.seed().

gen_para

A string, the parametrization, "abk" or "pms".

adj_mat

A square matrix of 0/1s, the adjacency matrix.

n

A positive integer, the number of samples.

k_mode

One of 0, 1, 2. If k_mode == 1, the k (if gen_para == "abk") or sigmasq (if gen_para == "pms") parameter in each conditional Hurdle distribution is set to 1. If k_mode == 0, the k is set to 1/j (where j is the topological order of the current node) or sigmasq is set to j; if k_mode == 2 they are set in the opposite way.

min_num

A positive integer, the minimum number of 0s/1s in each column. If this is not satisfied, this random generator function will be rerun for up to 1000 times.

therun

A positive integer for internal use. Defaults to 1.

gen_uniform_degree

A positive integer, the maximum degree of the Hurdle polynomials in the conditional Hurdle distributions, defaults to 1. Ignored if parametrization == "abk".

Details

See the simulations section in the paper associated with this package for details.

Value

A generated data, containing

V

A matrix of 0/1s of dimension ncol(adj_mat) x n, equal to Y != 0.

Y

A data matrix of dimension ncol(adj_mat) x n.

Examples

1
2
x <- gen_zero_dat(1, "abk", make_dag(3, "chain"), 1000)
x <- gen_zero_dat(1, "pms", make_dag(3, "chain"), 1000)

sqyu/ZiDAG documentation built on Jan. 19, 2021, 4:11 p.m.