pangeo_fish.hmm.estimator.CachedEstimator.decode

pangeo_fish.hmm.estimator.CachedEstimator.decode#

CachedEstimator.decode(X, states=None, *, mode='viterbi', spatial_dims=None, temporal_dims=None, progress=False, additional_quantities=['distance', 'speed'])#

Decode the state sequence from the selected model and the data

Parameters:
  • X (xarray.Dataset) – The emission probability maps. The dataset should contain these variables:

    • pdf, the emission probabilities

    • mask, a mask to select ocean pixels

    • initial, the initial probability map

    • final, the final probability map (optional)

  • states (xarray.Dataset, optional) – The precomputed state probability maps. The dataset should contain these variables:

    • states, the state probabilities

  • mode (str or list of str, default: "viterbi") – The decoding method. Can be one of:

    • "mean": use the centroid of the state probabilities as decoded state

    • "mode": use the maximum of the state probabilities as decoded state

    • "viterbi": use the viterbi algorithm to determine the most probable states

    If a list of methods is given, decode using all methods in sequence.

  • additional_quantities (None or list of str, default: [``”distance”, ``"speed"]) – Additional quantities to compute from the decoded tracks. Use None or an empty list to not compute anything.

    Possible values are:

    • "distance": distance to the previous track point in [km]

    • "speed": average speed for the movement from the previous to the current

      track point, in [km/h]

  • spatial_dims (list of hashable, optional) – The spatial dimensions of the dataset.

  • temporal_dims (list of hashable, optional) – The temporal dimensions of the dataset.