Skip to content

Sampling from FractionalGaussianNoise and ColoredNoise leads to arrays of different size #77

Open
@JoseAlanis

Description

@JoseAlanis

Hi,

sampling from FractionalGaussianNoise and ColoredNoiseas follows:

import stochastic.processes.noise as sn
import numpy as np

rng = np.random.default_rng(seed=42)

n = 10000

br_noise = sn.ColoredNoise(beta=2.0, rng=rng).sample(n)
fr_noise =  sn.FractionalGaussianNoise(hurst=0.5, rng=rng).sample(n)

Results in arrays of unequal length:

br_noise.shape
# Out: (10001,)

fr_noise.shape
# Out: (10000,)

Is this the intended behaviour?

I believe both classes internally check that n is a positive integer. However, ColoredNoise then does n = n + 1

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