Skip to main content

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


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)

Uploaded Source

Built Distribution

rnd_pcw_poly-0.2.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

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