Skip to content

Commit

Permalink
Resolve #8: added exhaustive list of random processes from chapter 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdi committed Nov 23, 2023
1 parent 42d4bbc commit 8431f24
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ select = ["E",
"PL",
"NPY",
"PERF",
"C90"]
"C90",
"RUF"]
ignore = ["D213", "D401", "D211"]

[tool.ruff.lint.pydocstyle]
Expand Down
45 changes: 41 additions & 4 deletions pyssp/system.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,57 @@
"""Chapter 3, stochastic systems."""


import random
from collections.abc import Generator
from typing import NoReturn


def arma(p: int, q: int, process: None | Generator = None) -> NoReturn:
class RandomProcess(random.Random):
"""Random process base class."""


def arma(p: int, q: int, N: int, process: None | Generator = None) -> NoReturn:
"""Auto-regressive Moving-Average."""
raise NotImplementedError()


def ar(p: int, process: None | Generator = None) -> NoReturn:
def ar(p: int, N: int, process: None | Generator = None) -> NoReturn:
"""Auto-regressive."""
raise NotImplementedError()


def ma(q: int, process: None | Generator = None) -> NoReturn:
"""Moving Average."""
def ma(q: int, N: int, process: None | Generator = None) -> NoReturn:
"""Moving Average Random (stochastic) process."""
raise NotImplementedError()


def harmonic(A: int, process: None | Generator = None) -> NoReturn:
"""The harmonic random process."""
raise NotImplementedError()


def white_noise(variance: float) -> NoReturn:
"""The harmonic random process.
Page 93.
"""

Check failure on line 37 in pyssp/system.py

View workflow job for this annotation

GitHub Actions / build

Ruff (D205)

pyssp/system.py:34:5: D205 1 blank line required between summary line and description
raise NotImplementedError()


def white_gaussian_noise() -> NoReturn:
"""A random process consisting of a sequence of uncorrelated real-valued Gaussian random
variables.
Page 94.
"""

Check failure on line 47 in pyssp/system.py

View workflow job for this annotation

GitHub Actions / build

Ruff (D205)

pyssp/system.py:42:5: D205 1 blank line required between summary line and description
raise NotImplementedError()


def bernoulli() -> NoReturn:
"""The Bernoulli process consists of a sequence of uncorrelated Bernoulli variables (-1, 1).
Page 94.
"""
raise NotImplementedError()

0 comments on commit 8431f24

Please sign in to comment.