MLPKriging::simulate
Description
Simulate paths from an MLPKriging model.
Usage
Python
# mk = MLPKriging(...) mk.simulate(nsim = 1, seed = 123, x = x, will_update = False)
R
# mk <- MLPKriging(...) mk$simulate(nsim = 1, seed = 123, x = x, will_update = FALSE)
Matlab/Octave
% mk = MLPKriging(...) mk.simulate(nsim = 1, seed = 123, x = x, will_update = false)
Julia
# mk = MLPKriging(...) s = simulate(mk, nsim=1, seed=123, x=x, will_update=false)
Arguments
Argument |
Description |
|---|---|
|
Number of simulation paths. Default |
|
Random seed. Default |
|
Numeric matrix of simulation points (\(m \times d\)). |
|
Logical. Set to |
Details
The MLP feature extractor is applied first, then the GP conditional simulation is performed in the learned latent feature space.
Value
A matrix with nrow(x) rows and nsim columns containing the simulated paths.
Examples
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
X <- as.matrix(seq(0.05, 0.95, length.out = 10))
y <- f(X)
mk <- MLPKriging(
y, X,
hidden_dims = c(4L),
d_out = 1L,
activation = "tanh",
kernel = "gauss",
parameters = list(max_iter_adam = "20", max_iter_bfgs = "10")
)
x <- as.matrix(seq(0, 1, length.out = 101))
s <- mk$simulate(nsim = 10, seed = 123, x = x)
plot(f)
points(X, y, col = "blue")
matlines(x, s, col = rgb(0, 0, 1, 0.2), type = "l", lty = 1)
Results
