Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation of quantiles. virtual_indexes : array_like The indexes where the percentile is supposed to be found in the sorted sample. previous_indexes : array_like The floor values of virtual_indexes.
(virtual_indexes, previous_indexes, method)
| 4568 | |
| 4569 | |
| 4570 | def _get_gamma(virtual_indexes, previous_indexes, method): |
| 4571 | """ |
| 4572 | Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation |
| 4573 | of quantiles. |
| 4574 | |
| 4575 | virtual_indexes : array_like |
| 4576 | The indexes where the percentile is supposed to be found in the sorted |
| 4577 | sample. |
| 4578 | previous_indexes : array_like |
| 4579 | The floor values of virtual_indexes. |
| 4580 | method : dict |
| 4581 | The interpolation method chosen, which may have a specific rule |
| 4582 | modifying gamma. |
| 4583 | |
| 4584 | gamma is usually the fractional part of virtual_indexes but can be modified |
| 4585 | by the interpolation method. |
| 4586 | """ |
| 4587 | gamma = np.asanyarray(virtual_indexes - previous_indexes) |
| 4588 | gamma = method["fix_gamma"](gamma, virtual_indexes) |
| 4589 | # Ensure both that we have an array, and that we keep the dtype |
| 4590 | # (which may have been matched to the input array). |
| 4591 | return np.asanyarray(gamma, dtype=virtual_indexes.dtype) |
| 4592 | |
| 4593 | |
| 4594 | def _lerp(a, b, t, out=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…