Generate random piecewise polynomials
Project description
rnd-pcw-poly
Generates random piecewise polynomial functions (for example for testing CPD-algorithms).
Example
import numpy as np
import matplotlib.pyplot as plt
from rnd_pcw_poly import rnd_pcw_poly
# generate a piecewise polynomial function with 5 "jumps" / 6 segments;
# no more than 200 degrees of freedom in total and locally no more than
# 6 degrees of freedom.
p = rnd_pcw_poly(5, 200, 6)
# plot it
xs = np.linspace(0,1,5000)
ys = p(xs)
plt.scatter(xs, ys)
plt.show()
The algorithm has seperately seedable and idependent core characteristics like jump locations, dof distribution, realization etc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rnd_pcw_poly-0.2.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for rnd_pcw_poly-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcf810c39ec299d06205e4bfb714b23bdee7305f5bfacae649604e52ba03145e |
|
MD5 | 0239dd50a4baf815c716ad95bd73a176 |
|
BLAKE2b-256 | 18261276acbbdc92359cbc74f86686596ef10903e49e5d0cbd797ed0a26fa6e0 |