RNAmf_two_level {RNAmf} | R Documentation |
Fitting the Recursive non-additive model with two fidelity levels.
Description
The function fits RNA models with designs of two fidelity levels. The estimation method is based on MLE. Possible kernel choices are squared exponential, Matern kernel with smoothness parameter 1.5 and 2.5. The function returns fitted model at level 1 and 2, whether constant mean or not, and kernel choice.
Usage
RNAmf_two_level(X1, y1, X2, y2, kernel = "sqex", constant = TRUE, ...)
Arguments
X1 |
vector or matrix of input locations for the low fidelity level. |
y1 |
vector of response values for the low fidelity level. |
X2 |
vector or matrix of input locations for the high fidelity level. |
y2 |
vector of response values for the high fidelity level. |
kernel |
character specifying kernel type to be used, to be chosen between |
constant |
logical indicating for constant mean of GP ( |
... |
for compatibility with |
Details
Consider the model
where
is the simulation code at fidelity level
, and
is GP model.
Hyperparameters
are estimated by
maximizing the log-likelihood via an optimization algorithm "L-BFGS-B".
For
constant=FALSE
, .
Covariance kernel is defined as:
with
for squared exponential kernel;
kernel="sqex"
,
for Matern kernel with the smoothness parameter of 1.5;
kernel="matern1.5"
and
for Matern kernel with the smoothness parameter of 2.5;
kernel="matern2.5"
.
For details, see Heo and Sung (2024, <doi:10.1080/00401706.2024.2376173>).
Value
-
fit1
: list of fitted model for.
-
fit2
: list of fitted model for.
-
constant
: copy ofconstant
. -
kernel
: copy ofkernel
. -
level
: a level of the fidelity. It returns 2. -
time
: a scalar of the time for the computation.
See Also
predict.RNAmf
for prediction.
Examples
### two levels example ###
library(lhs)
### Perdikaris function ###
f1 <- function(x) {
sin(8 * pi * x)
}
f2 <- function(x) {
(x - sqrt(2)) * (sin(8 * pi * x))^2
}
### training data ###
n1 <- 13
n2 <- 8
### fix seed to reproduce the result ###
set.seed(1)
### generate initial nested design ###
X <- NestedX(c(n1, n2), 1)
X1 <- X[[1]]
X2 <- X[[2]]
### n1 and n2 might be changed from NestedX ###
### assign n1 and n2 again ###
n1 <- nrow(X1)
n2 <- nrow(X2)
y1 <- f1(X1)
y2 <- f2(X2)
### fit an RNAmf ###
fit.RNAmf <- RNAmf_two_level(X1, y1, X2, y2, kernel = "sqex")