Make 2D kernel smooth distribution

make_2d_kernel_dist(
  output,
  x,
  y,
  n = 200,
  lims = c(-0.1, 1.1, -0.1, 1.1),
  h,
  kde_fun = "ks"
)

Arguments

output

A matrix of simulation output.

x, y

The name of the target variable.

n, lims, h

Passed to ks::kde() or MASS::kde2d(). If using ks::kde, H = diag(h, 2, 2). Note: the definition of bandwidth (h) is different in two functions. To get a similar output, the h is about 50 to 5000 times smaller for ks::kde() than MASS::kde2d()

kde_fun

Which to use? Choices: "ks" ks::kde (default; faster and taking less memory); "MASS" MASS::kde2d.

Value

A kde2d-type list of smooth distribution.