Skip to content

Sampling is not accurate? #8

@kchuangk

Description

@kchuangk

Taking the code sample below, the maximum sample is always below 5.0.

use kernel_density_estimation::prelude::*;

fn main() {

    let observations: Vec<f32> = vec![4.99,5.0,5.01];
    
    let kde=KernelDensityEstimator::new(observations,Scott,Normal);
    let pdf_dataset: Vec<f32> = (0..101).into_iter().map(|x| x as f32 * 0.1).collect();
    let sample=kde.sample(pdf_dataset.as_slice(),10000);
    println!("{:?}",sample);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions