Learn R Programming

stochLAB (version 1.1.2)

sampler_hd: Customised sampling function wrapper

Description

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
)

Value

a vector of samples values from the distribution

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

Examples

Run this code
  sampler_hd(dat=0.1,
       mode='rtnorm',
       n=100,
       mean=9,
       sd=0.1)

Run the code above in your browser using DataLab