Skip to content

Jackknife Function¤

stamox.sample.jackknife_sample(data: ArrayLike) -> ArrayLike ¤

Generates num_samples jackknife samples from data with replacement.

Parameters:

Name Type Description Default
data array-like

The original data.

required

Returns:

Type Description
ArrayLike

An array of size (len(data)-1, len(data)) containing the jackknife samples.

Examples:

>>> import jax.numpy as jnp
>>> from stamox.functions import jackknife_sample
>>> data = jnp.arange(3)
>>> jackknife_sample(data)
Array([[1, 2],
        [0, 2],
        [0, 1]], dtype=int32)

stamox.sample.jackknife(data: ArrayLike, call: Callable[..., ~ReturnValue]) -> PyTree ¤

Computes the jackknife estimate of a given data set.

Parameters:

Name Type Description Default
data ArrayLike

The data set to be analyzed.

required
call Callable[..., ReturnValue]

A function to be applied to each sample.

required

Returns:

Type Description
PyTree

The jackknife estimate of the data set.

Examples:

>>> import jax.numpy as jnp
>>> from stamox.functions import jackknife
>>> data = jnp.arange(3)
>>> jackknife(data, lambda x: jnp.mean(x))
Array([1.5, 1. , 0.5], dtype=float32)