Open JoseAlanis opened 1 year ago
Hi,
sampling from FractionalGaussianNoise and ColoredNoiseas follows:
FractionalGaussianNoise
ColoredNoise
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 https://github.com/crflynn/stochastic/blob/90ffba84523751dd205e17c50c84be9904c13330/stochastic/processes/noise/colored_noise.py#L68
n
n = n + 1
Hi,
sampling from
FractionalGaussianNoise
andColoredNoise
as follows:Results in arrays of unequal length:
Is this the intended behaviour?
I believe both classes internally check that
n
is a positive integer. However,ColoredNoise
then doesn = n + 1
https://github.com/crflynn/stochastic/blob/90ffba84523751dd205e17c50c84be9904c13330/stochastic/processes/noise/colored_noise.py#L68