SignedMeasure¶
- class telescopic.SignedMeasure(atoms, weights, replicate, n_replicates)¶
The signed measures \(\hat\pi_r\) of \(R\) replicates.
\[\hat\pi_r(h) = \sum_{i : \mathrm{replicate}_i = r} \omega_i\,h(x_i)\]Each replicate’s weights sum to 1. Some are negative, so an estimate can fall outside the range of \(h\).
The arrays are checked at construction and stored as read-only views, without a copy: the attributes cannot be written to, but the arrays passed in still can.
- Attributes:
- mass(cell, n_cells)¶
Each replicate’s signed mass in each of
n_cellscells, such as histogram bins.- Parameters:
- Returns:
scipy.sparse.csr_array, shape (R, n_cells)At most one stored entry per atom, so its memory follows the atoms, not
R * n_cells.
- per_replicate(h)¶
The values \(\hat\pi_r(h)\) of each replicate.
- Parameters:
- h
callable() Maps atoms of shape
(n, d)to values of shape(n,)or(n, p).
- h
- Returns:
ndarray, shape (R,) or (R, p)
Notes
Cost: one call of
hon all \(N\) atoms, then one sparse product.