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  -1.134625 -0.41825068 -5.3512101  -2.1863874 -0.1171668
#> 40   3.868503 -5.15155399 -0.4109192   0.3598501 -8.7956117
#> 60   2.898948 -4.48941822 -1.4023083 -11.8751456 -9.8050575
#> 80   3.881835  0.02672413 -5.8524155  -8.5076190 -5.2344527
#> 100  4.438674 -1.18197049 -8.6352625  -7.7258705 -6.5982704
rasym(7, 100, 5, mean=TRUE)
#>               1           2          3          4           5           6
#> 20  -0.14430239 -0.26998121 0.28552594 0.12821372 -0.55065932 -0.33833770
#> 40  -0.10927322 -0.16688174 0.24653982 0.21792668 -0.23976965 -0.03987268
#> 60  -0.08898889 -0.11573727 0.03309067 0.16280048 -0.14337311  0.01888462
#> 80  -0.09843654 -0.03772754 0.07332249 0.05905538 -0.06823221  0.07532915
#> 100 -0.02808326  0.02199190 0.11569708 0.06142590 -0.05924835 -0.04035897
#>             7
#> 20  0.6249250
#> 40  0.5989042
#> 60  0.3287466
#> 80  0.2192967
#> 100 0.2187132