| genpopUniform {BalancedSampling} | R Documentation |
Generate populations
Description
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.
Usage
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
)
Arguments
size |
The size of the population |
dims |
The number of auxiliary variables |
from |
A number or a vector of size |
to |
A number or a vector of size |
parents |
The number of parent locations |
children |
A number or a vector of size |
distribution |
A function taking a number as a variable, returning the offset from the parent location. |
mirror |
If |
Functions
-
genpopPoisson(): Poisson cluster process
Examples
## Not run:
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);
## End(Not run)
## Not run:
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);
## End(Not run)