Package jline.lib.m3a

Object M3aUtils.Companion

    • Constructor Detail

    • Method Detail

      • computeAutocorrelation

         final DoubleArray computeAutocorrelation(MatrixCell MMAP, Integer maxLag)

        Computes the autocorrelation function of an MMAP up to the specified lag. Uses the first two matrices (D0, D1) of the MMAP which form a valid MAP.

        Parameters:
        MMAP - the MMAP to analyze
        maxLag - maximum lag to compute
        Returns:

        array of autocorrelation values for lags 1 to maxLag

      • computeIDC

         final Double computeIDC(MatrixCell MMAP, Double timeWindow)

        Computes the index of dispersion for counts (IDC) of an MMAP. Uses the first two matrices (D0, D1) of the MMAP which form a valid MAP.

        Parameters:
        MMAP - the MMAP to analyze
        timeWindow - the time window for IDC computation (ignored, uses asymptotic IDC)
        Returns:

        the index of dispersion for counts

      • computeCoeffVar

         final Double computeCoeffVar(MatrixCell MMAP)

        Computes the coefficient of variation of an MMAP. Uses the first two matrices (D0, D1) of the MMAP which form a valid MAP.

        Parameters:
        MMAP - the MMAP to analyze
        Returns:

        the coefficient of variation

      • computeMoments

         final DoubleArray computeMoments(MatrixCell MMAP, Integer n)

        Computes the first n moments of an MMAP. Uses the first two matrices (D0, D1) of the MMAP which form a valid MAP.

        Parameters:
        MMAP - the MMAP to analyze
        n - number of moments to compute
        Returns:

        array of the first n moments

      • computeSpectralGap

         final Double computeSpectralGap(MatrixCell MMAP)

        Computes the spectral gap of an MMAP generator matrix.

        Parameters:
        MMAP - the MMAP to analyze
        Returns:

        the spectral gap (difference between largest and second-largest eigenvalue)

      • optimizeParameters

         final DoubleArray optimizeParameters(DoubleArray initialParams, Function1<DoubleArray, Double> objectiveFunction, Array<Function1<DoubleArray, Double>> constraints, Double tolerance)

        Optimizes MMAP parameters using COBYLA optimization.

        Parameters:
        initialParams - initial parameter vector
        objectiveFunction - objective function to minimize
        constraints - constraint functions
        tolerance - optimization tolerance
        Returns:

        optimized parameter vector

      • computeKLDivergence

         final Double computeKLDivergence(MatrixCell MMAP1, MatrixCell MMAP2, Integer numSamples, Integer seed)

        Computes the Kullback-Leibler divergence between two MMAPs.

        Parameters:
        MMAP1 - first MMAP
        MMAP2 - second MMAP
        numSamples - number of samples for estimation
        seed - random seed for reproducible results
        Returns:

        KL divergence estimate

      • validateMMAP

         final Boolean validateMMAP(MatrixCell MMAP)

        Validates that a matrix represents a valid MMAP.

        Parameters:
        MMAP - the MMAP to validate
        Returns:

        true if the MMAP is valid, false otherwise