Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JoseAlanis opened this issue Nov 29, 2022 · 0 comments

Comments

@JoseAlanis
Copy link

JoseAlanis commented Nov 29, 2022

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

@JoseAlanis JoseAlanis changed the title sampling from FractionalGaussianNoise and ColoredNoise Sampling from FractionalGaussianNoise and ColoredNoise leads to arrays of different size Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant