Skip to contents

Returns the sum of bernoulli variables with different probabilities.

Usage

rasym(n, N, len = N, mu = 0, mean = FALSE)

Arguments

n

Number of random variates to generate.

N

Maximum sample size.

len

Length of sequence; default: all

mu

Mean of normal distribution; default: 0

mean

Return means (instead of sums?); default: FALSE

Examples

rasym(5, 100, 5)
#>             1         2         3           4          5
#> 20   4.709662 -1.330734  7.850948 -0.07862795 -0.5801302
#> 40   5.301165 -2.038387 12.761816  9.68912690 -0.9351269
#> 60  13.833318 -7.296278  8.492578  7.49901520 -0.2232562
#> 80  14.514838 -3.499219  4.784944  2.01308469  0.1798825
#> 100 17.792550 -5.548255 12.250855  5.38091080  2.8553171
rasym(7, 100, 5, mean=TRUE)
#>               1             2           3           4          5            6
#> 20  -0.17784822  0.0798172461 -0.06839332  0.07400803 -0.5485359  0.269307344
#> 40  -0.09369812  0.0007621148  0.01672784 -0.01599568 -0.1516550 -0.029240893
#> 60  -0.01824037  0.0296869500  0.08433631  0.07049303 -0.1210038  0.019809748
#> 80  -0.06253935  0.0141081857  0.12545730  0.19830441 -0.1308021 -0.002960527
#> 100 -0.06358219 -0.0187235178  0.10910644  0.20644339 -0.1829000  0.024731051
#>              7
#> 20  0.30479222
#> 40  0.07169254
#> 60  0.06668900
#> 80  0.07269527
#> 100 0.14985062