
Last chance! 50% off unlimited learning
Sale ends in
Generate uniform and poisson cluster process populations
If from
and to
is used with genpopPoisson
together with mirror
, the
population will be bounded within these values.
For the genpopUniform
, these numbers represent the minimum and maximum
values of the uniform distribution.
genpopUniform(size, dims = 2L, from = 0, to = 1)genpopPoisson(
parents,
children,
dims = 2L,
from = 0,
to = 1,
distribution = function(n) rnorm(n, 0, 0.02),
mirror = TRUE
)
The size of the population
The number of auxiliary variables
A number or a vector of size dims
with the minimum values
A number or a vector of size dims
with the maximum values
The number of parent locations
A number or a vector of size parents
with the mean number of
children to be spawned.
A function taking a number as a variable, returning the offset from the parent location.
If TRUE
, the population is mirrored to be inside from
and to
.
genpopPoisson()
: Poisson cluster process
if (FALSE) {
set.seed(12345);
x = genpopUniform(120, 2L);
N = nrow(x);
n = 60;
prob = rep(n / N, N);
s = lpm2(prob, x);
b = sb(prob, x, s);
}
if (FALSE) {
set.seed(12345);
x = genpopPoisson(70, 50, 2L);
N = nrow(x);
n = 60;
prob = rep(n / N, N);
s = lpm2(prob, x);
b = sb(prob, x, s);
}
Run the code above in your browser using DataLab