Skip to contents

Simulates data from a Logistic Normal Multinomial Model.

Usage

lnm_data(N = 100, D = 5, K = 10)

Arguments

N

The number of samples in the output data.

D

The number of covariates, each of which can influence the response composition vector (e.g., the timepoint or disease status).

K

The number of output dimensions (e.g., number of taxa).

Value

A list with the following components:

X

An N x D matrix of covariates.

y

The N x K simulated samples.

B

The D x K relationship between covariates and outputs.

Examples

lnm_data(5, 3, 3)
#> $X
#> # A tibble: 5 × 3
#>      x1    x2    x3
#>   <dbl> <dbl> <dbl>
#> 1 0.872 0.789 0.345
#> 2 0.279 0.379 0.188
#> 3 0.713 0.994 0.404
#> 4 0.402 0.200 0.221
#> 5 0.963 0.606 0.753
#> 
#> $y
#> # A tibble: 5 × 3
#>      y1    y2    y3
#>   <int> <int> <int>
#> 1  1434  5312  3254
#> 2  2333  4243  3424
#> 3  1274  5492  3234
#> 4  2479  3896  3625
#> 5  1227  4704  4069
#> 
#> $B
#>           [,1]      [,2]
#> [1,] 0.6751061 0.4837508
#> [2,] 0.8057973 0.1712098
#> [3,] 0.2398897 0.8047298
#>