View source: R/MultiDimIntegral.R
IntegrateRandomVectorsProduct | R Documentation |
Computes the integral outer product of two possibly complex random vectors.
IntegrateRandomVectorsProduct(f_fct, X, g_fct, Y, s_min, s_max, subdivisions = 50, method = c("Uniform", "Simpson"), randomIntegrationLaw = c("norm","unif"), ...)
f_fct |
function object with signature |
X |
random vector where the function |
g_fct |
function object with signature |
Y |
random vector where the function |
s_min,s_max |
limits of integration. Should be finite. |
subdivisions |
maximum number of subintervals. |
method |
numerical integration rule, one of |
randomIntegrationLaw |
Random law pi(s) to be applied to the Random product vector, see
Details. Choices are |
... |
other arguments to pass to random integration law. Mainly, the mean
( |
The function computes the nx \times ny matrix C = \int_{s_{min}}^{s_{max}} f_s(X) g_s(Y) π(s) ds, such as the one used in the objective function of the Cgmm method. This is essentially an outer product with with multiplication replaced by integration.
There is no function in R to compute vectorial integration and
computing C element by element using integrate
may
be very slow when length(X)
(or length(y)
) is large.
The function allows complex vectors as its integrands.
an nx \times ny matrix C with elements:
c_{ij} = \int_{s_{min}}^{s_{max}} f_s(X_i) g_s(Y_j) π(s) ds .
## Define the integrand f_fct <- function(s, x) { sapply(X = x, FUN = sampleComplexCFMoment, t = s, theta = theta) } f_bar_fct <- function(s, x) Conj(f_fct(s, x)) ## Function specific arguments theta <- c(1.5, 0.5, 1, 0) set.seed(345) X <- rstable(3, 1.5, 0.5, 1, 0) s_min <- 0; s_max <- 2 numberIntegrationPoints <- 10 randomIntegrationLaw <- "norm" Estim_Simpson <- IntegrateRandomVectorsProduct(f_fct, X, f_bar_fct, X, s_min, s_max, numberIntegrationPoints, "Simpson", randomIntegrationLaw) Estim_Simpson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.