Constructs a semi-deterministic Plinko board. The board is semi-deterministic in that the final values are predetermined, but the paths to get from the drop point to the values are random.

plinko_board(x, ...)

# S3 method for numeric
plinko_board(
  x,
  n_bin,
  bin_width,
  n_ball = NULL,
  center = NULL,
  limits = NULL,
  row_ratio = 2,
  frames_till_drop = 4,
  slot_height = NULL,
  stack = TRUE,
  ...
)

# S3 method for distribution
plinko_board(
  x,
  n_bin = NULL,
  bin_width = NULL,
  n_ball = 50,
  sampling = c("quantiles", "random"),
  center = NULL,
  ...
)

Arguments

x

The final values that the Plinko board will "sediment" to.

...

Arguments passed on to lower-level implementations of plinko_board(). Currently all implementations call down to plinko_board.numeric(), so ... may include arguments to that function not otherwise defined.

n_bin

The number of bins used in the Binomial approximation of x.

bin_width

The width of the bins used in the Binomial approximation of x

n_ball

The number of balls to drop. Defaults to length(x).

center

The location at which to drop balls. Defaults to mean(x).

limits

The minimum and maximum value shown on the board. Defaults to range(x).

row_ratio

The ratio between the width of the slots and the height of a single row. Defaults to 2

frames_till_drop

The number of frames in between each drop of a ball. Defaults to 4.

slot_height

Height of the slots. If NULL (the default), determined automatically based on the height of the highest bin plus a bit of overhead.

stack

Should the balls stack on top of each other? Default TRUE.

sampling

For plinko_board.distribution, how to "sample" balls from the distribution. Use "quantiles", uses quantiles of the distribution; if "random", samples balls randomly.

Value

An object of class c("plinko_board", "list").