| simMVGPR | R Documentation |
simMVGPR generates simulated data for Multivariate Gaussian Process Regression (MVGPR) models,
including the true hyperparameters used for simulation.
simMVGPR(
N = 200,
M = 2,
d = 3,
sigma2 = 0.1,
tau = 2,
kernel_func = kernel_se,
perc_spars = 0.5,
rho = 0,
theta,
Omega,
device
)
N |
Positive integer specifying the number of observations to simulate. Default is 200. |
M |
positive integer specifying the number of response variables. Default is 2. |
d |
Positive integer specifying the number of covariates for the covariance structure. Default is 3. |
sigma2 |
Positive numeric value specifying the noise variance. Default is 0.1. |
tau |
Positive numeric value specifying the global shrinkage parameter. Default is 2. |
kernel_func |
Function specifying the covariance kernel. Default is |
perc_spars |
Numeric value in [0, 1] indicating the proportion of inactive (zero) inverse length-scale parameters in |
rho |
Numeric value in [0, 1] indicating the correlation between the covariates. Default is 0. |
theta |
Optional numeric vector specifying the true inverse length-scale parameters. If not provided, they are randomly generated. |
Omega |
Optional positive definite matrix of size |
device |
Optional |
This function simulates data from a multivariate Gaussian process regression model.
The response variable y is sampled from a matrix normal distribution with
a covariance matrix determined by the specified kernel function, theta, tau,
the correlation matrix Omega and sigma2 in the following way:
\bm Y \sim \mathcal{MN}_{N,M}(\bm 0, \bm K(\bm x; \bm \theta, \tau) + \bm I \sigma^2, \bm \Omega)
which is equivalent to
vec(\bm Y) \sim \mathcal{N}_{NM}(\bm 0, \bm \Omega \otimes (\bm K(\bm x; \bm \theta, \tau) + \bm I \sigma^2))
.
A list containing:
data: A data frame with M + d columns y.1, ..., y.M (response variables) and
x.1, ..., x.d (covariates for the covariance structure).
true_vals: A list containing the true values used for the simulation:
theta: The true inverse length-scale parameters.
sigma2: The true noise variance.
tau: The true global shrinkage parameter.
if (torch::torch_is_installed()) {
torch::torch_manual_seed(123)
# Simulate data with default settings
sim_data <- simMVGPR()
# Simulate data with custom settings
sim_data <- simMVGPR(N = 100, d = 5, perc_spars = 0.3, sigma2 = 0.5)
# Access the simulated data
head(sim_data$data)
# Access the true values used for simulation
sim_data$true_vals
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.