Skip to content

Implement Monte Carlo integration methods #24

@mikeingold

Description

@mikeingold

It should be relatively straight-forward to implement Monte Carlo integration methods since Meshes.jl provides built-in sampling algorithms. I imagine it would work something like:

using Statistics: mean

struct MonteCarlo{T} <: IntegrationAlgorithm where {T<:Meshes.ContinuousSamplingMethod}
    sampler::T
end

function _integral(f, geometry, settings::MonteCarlo)
    test_points = sample(geometry, settings.sampler)
    mean(f, test_points) * measure(geometry)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions