Logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2025 Patrick Müller. All rights reserved.

qspec.analyze.generate_collinear_points_py  (  mean cov n_samples = 100000 report = False ** kwargs  )[source]

Randomly generate points $\vec{p}_i$ according to the given data vectors $\vec{\mu}_i\in\mathbb{R}^n$ and covariance matrices $\mathbf{\Sigma}_i\in\mathbb{R}^{n\times n}$, under the condition that they are aligned on a straight line. This function uses pure Python.

Parameters:
meanndarray

The data vectors $\vec{\mu}_i$. Must have shape (k, n), where k is the number of data points and n is the number of dimensions of each point.

covndarray

The covariance matrices $\mathbf{\Sigma}_i$ of the data vectors. Must have shape (k, n, n). Use covariance_matrix to construct covariance matrices.

n_samplesint

The number of samples generated for each data point.

reportbool

Whether to report the number of samples.

kwargsNone

Additional keyword arguments.

Returns:
(p, n_accepted, n_samples)(ndarray, int, int)

The generated data vectors $\vec{p}_i$ with shape (n_accepted, k ,n) and the number of accepted and generated samples.

API navigation