Skip to contents

This function selects the appropriate integration method (Monte Carlo, Trapezoidal, or Gaussian-Legendre) based on the user's input and calls the corresponding function to compute the integral.

Usage

Approx.integration(
  method,
  period,
  y_tilde,
  v_tilde,
  tau_tilde,
  n_samples = NULL,
  n_intervals = NULL,
  n_points = NULL,
  epsilon = NULL
)

Arguments

method

Character, the integration method to use ("mc", "ti", or "gl").

period

Numeric vector, the integration interval.

y_tilde

Numeric, parameter for the exponential function in the integrand.

v_tilde

Numeric, parameter for the exponential function in the integrand.

tau_tilde

Numeric, parameter for the exponential function in the integrand.

n_samples

Integer, number of samples for Monte Carlo integration (if `method` is "mc").

n_intervals

Integer, number of intervals for Trapezoidal integration (if `method` is "ti").

n_points

Integer, number of points for Gaussian-Legendre integration (if `method` is "gl").

epsilon

Numeric, small value for Trapezoidal integration (if `method` is "ti").

Value

The result from the selected integration method.