forked from PySATL/pysatl-mpest
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
There is some issues in mathematical functions in distributions and mixture with scalar and non-scalar inputs. For example in core/mixture.py on lines 234-253:
def pdf(self, X: ArrayLike) -> NDArray[float64]:
"""Probability Density Function of the mixture.
The PDF is computed as the weighted sum of the PDFs of its
components.
Parameters
----------
X : ArrayLike
The input data points at which to evaluate the PDF.
Returns
-------
NDArray[np.float64]
The PDF values corresponding to each point in :attr:`X`.
"""
X = np.asarray(X, dtype=float64)
component_pdfs = np.array([comp.pdf(X) for comp in self.components])
return np.asarray(np.dot(self.weights, component_pdfs))Make sure that all functions returns scalar if the input is scalar and return ndarray with internal dtype if the input is non-scalar.
Add tests to it.
Metadata
Metadata
Assignees
Labels
No labels