This project demonstrates the use of importance sampling techniques to perform numerical integration using the Rust library Peroxide. The code compares three different methods of integration:
- G7K15R: A Gauss-Kronrod method with 7-point Gauss and 15-point Kronrod rules.
- Uniform Importance Sampling: A basic importance sampling method using a uniform distribution.
- Weighted Uniform Importance Sampling: A weighted importance sampling method that takes into account the function's characteristics.
The results, including the time taken and error for each method, are printed in a DataFrame.
- Rust programming language
- Peroxide crate
Run the project using:
cargo run --release
The output will display the integration results for each method, including the time taken, error percentage, and the value of the integral.
The function to be integrated. It can be modified to represent any continuous function.
A function that returns the true value of the integral for comparison purposes.
A function that performs importance sampling using a uniform distribution.
A function that performs importance sampling using a weighted uniform distribution.