Package org.ptolemy.machineLearning
Class Algorithms
- java.lang.Object
-
- org.ptolemy.machineLearning.Algorithms
-
public class Algorithms extends java.lang.Object
Algorithms class.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- ilgea
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Constructor Summary
Constructors Constructor Description Algorithms()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
_binaryIntervalSearch(double[] A, double key)
Do a binary interval search for the key in array A.static int
_binaryIntervalSearch(double[] A, double key, int imin, int imax)
Do a binary interval search for the key in array A.static double
mvnpdf(double[] y, double[] mu, double[][] sigma)
Compute the Gaussian pdf value with the given mean and covariance parameters at data point y.static double
poissonPmf(int k, double mean)
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the Poisson distribution with parameter mean.static double
poissonPmf(int k, double mean, double logFactorial)
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the poisson distribution with parameter mean.
-
-
-
Method Detail
-
poissonPmf
public static double poissonPmf(int k, double mean) throws IllegalActionException
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the Poisson distribution with parameter mean.- Parameters:
k
- The value at which the probability mass function will be computedmean
- The mean (lambda) of the poisson distribution- Returns:
- The PMF value at k.
- Throws:
IllegalActionException
- If k < 0.
-
poissonPmf
public static double poissonPmf(int k, double mean, double logFactorial) throws IllegalActionException
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the poisson distribution with parameter mean.- Parameters:
k
- The value at which the probability mass function will be computedmean
- The mean (lambda) of the poisson distributionlogFactorial
- The log factorial- Returns:
- The PMF value at k.
- Throws:
IllegalActionException
- If k < 0.
-
_binaryIntervalSearch
public static int _binaryIntervalSearch(double[] A, double key)
Do a binary interval search for the key in array A. The bin index in which key is found is returned.- Parameters:
A
- The search arraykey
- Key to be searched- Returns:
- the found key index.
-
_binaryIntervalSearch
public static int _binaryIntervalSearch(double[] A, double key, int imin, int imax)
Do a binary interval search for the key in array A. The bin index in which key is found is returned.- Parameters:
A
- A The search arraykey
- Key to be searchedimin
- minimum array index to look for keyimax
- maximum array index to look for key- Returns:
- the found key index, or value of KEY_NOT_FOUND for not found.
-
mvnpdf
public static double mvnpdf(double[] y, double[] mu, double[][] sigma)
Compute the Gaussian pdf value with the given mean and covariance parameters at data point y.- Parameters:
y
- observation pointmu
- mean arraysigma
- covariance matrix- Returns:
- value of the probability distribution
-
-