Make a matrix of 2D static landscape plots for one or two parameters
Source:R/multiple_simulation_landscape.R
make_2d_matrix.Rd
Make a matrix of 2D static landscape plots for one or two parameters
Usage
make_2d_matrix(
bs,
x,
rows = NULL,
cols,
lims,
kde_fun = c("ks", "base"),
n = 200,
h,
adjust = 1,
Umax = 5,
individual_landscape = TRUE
)
Arguments
- bs
A
batch_simulation
object created by[batch_simulation()].
- x
The name of the target variable.
- rows, cols
The names of the parameters.
rows
can be left blank if only one parameter is needed.- lims
The limits of the range for the density estimator as
c(xl, xu)
for 2D landscapes,c(xl, xu, yl, yu)
for 3D landscapes,c(xl, xu, yl, yu, zl, zu)
for 4D landscapes. If missing, the range of the data extended by 10% for both sides will be used. For landscapes based on multiple simulations, the largest range of all simulations (which means the lowest lower limit and the highest upper limit) will be used by default.- kde_fun
Which kernel estimator to use? Choices: "ks"
ks::kde()
(default; faster and using less memory); "base"base::density()
(only for 2D landscapes); "MASS"MASS::kde2d()
(only for 3D landscapes).- n
The number of equally spaced points in each axis, at which the density is to be estimated.
- h
A number, or possibly a vector for 3D and 4D landscapes, specifying the smoothing bandwidth to be used. If missing, the default value of the kernel estimator will be used (but
bw = "SJ"
forbase::density()
). Note that the definition of bandwidth might be different for different kernel estimators. For landscapes based on multiple simulations, the largesth
of all simulations will be used by default.- adjust
The multiplier to the bandwidth. The bandwidth used is actually
adjust * h
. This makes it easy to specify values like "half the default" bandwidth.- Umax
The maximum displayed value of potential.
- individual_landscape
Make individual landscape for each simulation? Default is
TRUE
so that it is possible to calculate barriers. Set toFALSE
to save time.