Interface ComparableDiscreteGenerator<TShared, TInternal, TData>

Interface which extends DiscreteGenerator by adding functionality to compare particle state with observed data.

interface ComparableDiscreteGenerator<TShared, TInternal, TData> {
    compareData(
        time: number,
        state: number[],
        data: TData,
        shared: TShared,
        internal: TInternal,
        random: Random,
    ): number;
    initial(
        time: number,
        shared: TShared,
        internal: TInternal,
        stateNext: number[],
        random: Random,
    ): void;
    internal(shared: TShared): TInternal;
    packingState(shared: TShared): Packer;
    update(
        time: number,
        dt: number,
        state: number[],
        shared: TShared,
        internal: TInternal,
        stateNext: number[],
        random: Random,
    ): void;
    updateShared(shared: TShared, newShared: TShared): void;
}

Type Parameters

  • TShared

    Values which are shared between all particles in a group and are not mutated by them - the model parameter values for that group

  • TInternal

    Internal state values which can be mutated by generators, used to improve efficiency of the system by e.g. caching calculation results for use by other particles.

  • TData

    Type of each data point which will be compared with system state.

Hierarchy (View Summary)

Methods

  • Compares the state of a particle with a data point, and returns the log likelihood of the state given the data.

    Parameters

    • time: number

      The system time for which the data point applies

    • state: number[]

      The particle state to compare to the data

    • data: TData

      The data point

    • shared: TShared

      The shared parameter values used by the particle's group

    • internal: TInternal

      The internal state used by the particle's group

    • random: Random

      A random number generator which may be used by the generator to compare values

    Returns number

  • Sets the initial state of a particle.

    Parameters

    • time: number

      The current time at which to initialise particle state

    • shared: TShared

      The shared parameter values used by the particle's group

    • internal: TInternal

      The internal state used by the particle's group

    • stateNext: number[]

      The array of values which should be updated by the generator with initial particle state values

    • random: Random

      A random number generator which may be used by the generator to initialise values

    Returns void

  • Updates the state of a particle from its previous state.

    Parameters

    • time: number

      The new time to which the particle state should be updated.

    • dt: number

      The time step from the current time to the new time

    • state: number[]

      The current state of the particle

    • shared: TShared

      The shared parameter values used by the particle's group

    • internal: TInternal

      The internal state used by the particle's group

    • stateNext: number[]

      The array of values which should be updated by the generator with new particle state values

    • random: Random

      A random number generator which may be used by the generator to update values

    Returns void

MMNEPVFCICPMFPCPTTAAATR