Skip to contents

Samples a dataset based on inputs for either the rtnorm, rbeta or 'rnorm' distributions

Usage

sampler_hd(
  dat,
  mode = "rtnorm",
  n = NULL,
  mean = NULL,
  sd = NULL,
  lower = 0,
  upper = NULL
)

Arguments

dat

= A decimal value. The SD value to test (from the UI) - if not available in the UI, then do not create a distribution

mode

= A string. Either 'rtnorm', 'rbeta' or 'rnorm' to determine which distribution to generate

n

An integer value. The number of samples to generate

mean

A decimal value. The mean for the truncated normal distribution

sd

A decimal value. The standard deviation of the distribution to simulate

lower

A decimal value. The lower limit for the distribution

upper

A decimal value. The upper limit for the distribution

Value

a vector of samples values from the distribution

Examples

  sampler_hd(dat=0.1,
       mode='rtnorm',
       n=100,
       mean=9,
       sd=0.1)
#>   [1] 9.018060 8.923789 9.149098 8.843698 8.985836 8.909738 9.124842 8.982686
#>   [9] 9.029920 9.056487 9.103273 8.991915 9.181838 8.840868 9.081293 9.027675
#>  [17] 8.999912 8.967177 9.168632 8.983260 9.034665 9.063153 9.007892 9.142822
#>  [25] 9.158502 9.034508 9.108253 8.965157 9.005255 8.936505 8.963286 8.811488
#>  [33] 8.905225 9.236296 9.005089 9.097625 8.809241 9.005111 9.266781 8.860530
#>  [41] 9.026057 8.952956 9.020429 8.944322 9.027311 8.897340 8.909571 8.907136
#>  [49] 8.870464 8.935067 8.959291 8.982625 9.067944 8.882087 8.776863 8.991132
#>  [57] 9.095710 8.836743 9.021169 9.220681 9.000107 9.010952 8.927899 8.990569
#>  [65] 9.010051 9.172587 8.933390 8.901488 8.855845 8.966999 9.033993 8.824172
#>  [73] 9.159706 8.991019 9.005898 9.004794 9.115728 9.056943 8.900337 9.015796
#>  [81] 9.211375 9.141908 9.082072 9.056306 8.886654 8.954851 9.095308 9.068714
#>  [89] 8.892164 8.976872 9.148204 9.072152 9.093848 8.894212 8.971367 9.003562
#>  [97] 8.890366 9.072950 9.023802 9.076570