Skip to content

Better support for multivariate distributions #496

@vks

Description

@vks

The Distribution trait does not work well for multivariate distributions, because impl Distribution<Vec<f64>> for Multivariate requires an allocation for every sample (see #485 for an example). Maybe we should add another trait:

pub trait MultivariateDistribution<T> {                                                         
    fn sample_multi<R: Rng + ?Sized>(&self, rng: &mut R, buffer: &mut [T]);
}

With SIMD in mind, this might even make sense for univariate distribution. So we might want to add sample_multi to the Distribution trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-questionParticipation: opinions wantedP-lowPriority: Low

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions