Skip to main content

Fractional Brownian Noise (fGN) and Fractional Brownian Motion (fBM) generators in Python.

Project description

fracbm

Fractional Brownian Noise (fGN) and Fractional Brownian Motion (fBM) generators in Python.

Installation

pip  install  fracbm

Usage

import matplotlib.pyplot as plt
import fracbm

# Parameters
n = 1000      # number of steps
H = 0.8       # Hurst parameter

# Fractional Brownian motion using Davies–Harte
fbm_path = fracbm.daviesharte.motion(n, H)      # cumulative sum of fGn
fgn_increments = fracbm.daviesharte.noise(n, H) # fractional Gaussian noise

# Plot the full fBm path
plt.figure(figsize=(10, 4))
plt.plot(fbm_path, label="fBm path (Davies–Harte)")
plt.xlabel("Step")
plt.ylabel("Value")
plt.title("Fractional Brownian Motion (H=0.8, Davies–Harte)")
plt.legend()
plt.show()

Features

Generate exact fractional Brownian motion using:

  • Cholesky decomposition, order $\mathcal{O}(n^3)$
  • Davies-Harte method, order $\mathcal{O}(n \log n)$ (recommended)

Vary the Hurst parameter $H \in [0,1]$:

  • $H = 0.5$ is regular Brownian motion.
  • $H > 0.5$ causes slowly decaying positive autocorrelations (positive increments tend to follow positive increments - increments follow a trend).
  • $H < 0.5$ causes fast-decaying negative autocorrelations (negative increments tend to follow positive increments - increments revert to the mean).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fracbm-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fracbm-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file fracbm-0.2.0.tar.gz.

File metadata

  • Download URL: fracbm-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fracbm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 68783c14f7a422e7a6a78415757208406734b9a4c9223272931a841596e2858b
MD5 dcef27c979ee2d807b67d7bc4e881693
BLAKE2b-256 c2f6f494eb38710d00997b732807b053a2d6c5443de6a4ff840bdc424232dd18

See more details on using hashes here.

File details

Details for the file fracbm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fracbm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fracbm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80659d07a55ffc35186a61037567a7d78b1c965da938a2b9883b93c0480c4f64
MD5 781a05818424757b1406545507ce3a33
BLAKE2b-256 e038321f17be5fd97833651f4e415928accb9e66822632f953ad7ad10b8d634d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page