Skip to contents

Generates samples from a multivariate Gaussian distribution and evaluates a simple linear transformation model.

Usage

gaussian_fun(N)

Arguments

N

Number of input samples to generate.

Value

A list with two elements:

  • x: a numeric matrix of size N x 8 containing the input samples.

  • y: a numeric vector of length N with the corresponding function outputs.

Details

Inputs x are sampled from: $$ \mathbf{X} \sim \mathcal{N}(\boldsymbol{\mu}, \Sigma), \quad \boldsymbol{\mu} = [1, 1, 1], \quad \Sigma = \begin{bmatrix} 1 & 0.5 & 0.5 \\ 0.5 & 1 & 0.5 \\ 0.5 & 0.5 & 1 \end{bmatrix} $$

The output is given by: $$ \mathbf{Y} = A \mathbf{X}^{\top}, \quad A = \begin{bmatrix} 4 & -2 & 1 \\ 2 & 5 & -1 \end{bmatrix} $$

Examples

result <- gaussian_fun(1000)
head(result$x)
#>              X1           X2          X3
#> [1,] -0.4000435  0.008374533  0.06703756
#> [2,]  1.2553171  0.940735445  1.16350886
#> [3,] -1.4372636  0.319284534 -0.57963016
#> [4,]  0.9944287 -0.114785226  0.19329631
#> [5,]  1.6215527  0.184863279  0.68936466
#> [6,]  2.1484116  1.247913878  0.97366463
head(result$y)
#>             Y1         Y2
#> [1,] -1.549886 -0.8252519
#> [2,]  4.303306  6.0508025
#> [3,] -6.967254 -0.6984744
#> [4,]  4.400582  1.2216350
#> [5,]  6.805849  3.4780572
#> [6,]  7.071483  9.5627280