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.1.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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fracbm-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 33de2c9ed92f041851862e1f03c2343c21a5257fc1e62f8d225cf7f77884f23d
MD5 7ab3d9e7d157c88099fe7e3ea45c08db
BLAKE2b-256 1742781203bf2b591fb1157ae12ecdcfa30baeb349b17c5d53f786cf79ac2e2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fracbm-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d344494ae4dc013d248c20378d304ed40f1c008df24b6f9f968fa79b071b2a4
MD5 608563e6d48bfee501b8e980229fcffc
BLAKE2b-256 dc07e9c886223fead8483cb6730b2bacfbbcff5b2f832949697d592eb3d39709

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