Central Limit Theorem simulation

clt(
  dist,
  n = 100,
  m = 100,
  norm_mean = 0,
  norm_sd = 1,
  binom_size = 10,
  binom_prob = 0.2,
  unif_min = 0,
  unif_max = 1,
  expo_rate = 1
)

Arguments

dist

Distribution to simulate

n

Sample size

m

Number of samples

norm_mean

Mean for the normal distribution

norm_sd

Standard deviation for the normal distribution

binom_size

Size for the binomial distribution

binom_prob

Probability for the binomial distribution

unif_min

Minimum for the uniform distribution

unif_max

Maximum for the uniform distribution

expo_rate

Rate for the exponential distribution

Value

A list with the name of the Distribution and a matrix of simulated data

Details

See https://radiant-rstats.github.io/docs/basics/clt.html for an example in Radiant

Examples

clt("Uniform", 10, 10, unif_min = 10, unif_max = 20)
#> $dist #> [1] "Uniform" #> #> $sim #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] #> [1,] 10.80750 18.74601 12.89892 10.31230 16.80163 14.61186 18.25199 14.46702 #> [2,] 18.34333 11.74941 16.78380 12.25563 14.98846 13.15242 12.73818 13.71511 #> [3,] 16.00761 10.34241 17.35320 13.00831 16.41679 11.74676 15.70045 10.28061 #> [4,] 11.57208 13.20386 11.95957 16.36466 16.60284 15.31574 13.35719 14.65987 #> [5,] 10.07399 14.02328 19.80540 14.79025 10.96024 14.93637 15.96263 13.90031 #> [6,] 14.66393 11.95670 17.41522 14.32171 17.65600 17.79309 11.91518 10.20065 #> [7,] 14.97777 14.03538 10.51446 17.06434 17.69675 12.04178 19.47764 13.76971 #> [8,] 12.89767 10.63661 15.30212 19.48577 19.90712 17.13397 15.42480 15.59913 #> [9,] 17.32882 13.88701 16.95824 11.80339 19.70521 10.65216 15.44603 18.57084 #> [10,] 17.72522 19.75548 16.88556 12.16900 13.89183 13.54207 12.78597 13.84810 #> [,9] [,10] #> [1,] 15.27917 19.97069 #> [2,] 16.00638 11.49035 #> [3,] 12.61371 15.18557 #> [4,] 12.90050 18.46120 #> [5,] 14.80075 17.18270 #> [6,] 19.20006 12.41314 #> [7,] 14.00720 15.47043 #> [8,] 12.13173 18.34802 #> [9,] 16.71767 10.27956 #> [10,] 10.58614 14.69384 #> #> attr(,"class") #> [1] "clt" "list"