/** * Stack matrices vertically * * @param matricies * matrices to stack * @return matrix created from the stacking */ public static Matrix vstack(Matrix... matricies) { return vstack(MatrixFactory.getDefault(), matricies); }
/** * Creates a new instance of InverseWishartDistribution * @param dimensionality * Dimensionality of the inverse-Wishart distribution, which sets * the degrees of freedom to two plus the dimensionality. */ public InverseWishartDistribution( final int dimensionality ) { this( MatrixFactory.getDefault().createIdentity(dimensionality, dimensionality ), dimensionality + 2 ); }
/** * Creates a new instance of MultivariateGaussianMeanBayesianEstimator * @param dimensionality * Dimensionality of the Vectors */ public MultivariateGaussianMeanBayesianEstimator( int dimensionality ) { this( MatrixFactory.getDefault().createIdentity(dimensionality,dimensionality) ); }
/** * Creates a new instance of MultivariateGaussianMeanBayesianEstimator * @param dimensionality * Dimensionality of the Vectors */ public MultivariateGaussianMeanBayesianEstimator( int dimensionality ) { this( MatrixFactory.getDefault().createIdentity(dimensionality,dimensionality) ); }
/** * Creates a new instance of MultivariateGaussianMeanBayesianEstimator * @param dimensionality * Dimensionality of the Vectors */ public MultivariateGaussianMeanBayesianEstimator( int dimensionality ) { this( MatrixFactory.getDefault().createIdentity(dimensionality,dimensionality) ); }
/** * Creates a new instance of InverseWishartDistribution * @param dimensionality * Dimensionality of the inverse-Wishart distribution, which sets * the degrees of freedom to two plus the dimensionality. */ public InverseWishartDistribution( final int dimensionality ) { this( MatrixFactory.getDefault().createIdentity(dimensionality, dimensionality ), dimensionality + 2 ); }
/** * Creates a new instance of MultivariateGaussian. * * @param dimensionality Dimensionality of the Gaussian to create. */ public MultivariateGaussian( int dimensionality) { this(VectorFactory.getDefault().createVector(dimensionality), MatrixFactory.getDefault().createIdentity(dimensionality, dimensionality)); }
/** * Creates a distribution with the given dimensionality. * @param dimensionality * Dimensionality of the distribution. */ public MultivariateStudentTDistribution( int dimensionality ) { this( DEFAULT_DEGREES_OF_FREEDOM, VectorFactory.getDefault().createVector(dimensionality), MatrixFactory.getDefault().createIdentity(dimensionality,dimensionality) ); }
/** * Creates a new instance of MultivariateGaussian. * * @param dimensionality Dimensionality of the Gaussian to create. */ public MultivariateGaussian( int dimensionality) { this(VectorFactory.getDefault().createVector(dimensionality), MatrixFactory.getDefault().createIdentity(dimensionality, dimensionality)); }
/** * Creates a distribution with the given dimensionality. * @param dimensionality * Dimensionality of the distribution. */ public MultivariateStudentTDistribution( int dimensionality ) { this( DEFAULT_DEGREES_OF_FREEDOM, VectorFactory.getDefault().createVector(dimensionality), MatrixFactory.getDefault().createIdentity(dimensionality,dimensionality) ); }
public Matrix differentiate( Vector input) { int M = input.getDimensionality(); Matrix dydx = MatrixFactory.getDefault().createIdentity(M,M).scale( this.getScaleFactor() ); return dydx; }
public Matrix differentiate( Vector input) { int M = input.getDimensionality(); Matrix dydx = MatrixFactory.getDefault().createIdentity(M,M).scale( this.getScaleFactor() ); return dydx; }
public Matrix getValue() { final int dim = this.conditionalDistribution.getInputDimensionality(); Matrix parameter = MatrixFactory.getDefault().createMatrix(dim, dim+1); parameter.setColumn(0, this.conditionalDistribution.getMean() ); parameter.setSubMatrix(0,1, this.conditionalDistribution.getCovariance() ); return parameter; }
public Matrix getMean() { Matrix C = this.inverseWishart.getMean(); Vector mean = this.gaussian.getMean(); final int d = this.getInputDimensionality(); Matrix R = MatrixFactory.getDefault().createMatrix(d, d+1); R.setColumn(0, mean); R.setSubMatrix(0, 1, C); return R; }
public Matrix getValue() { final int dim = this.conditionalDistribution.getInputDimensionality(); Matrix parameter = MatrixFactory.getDefault().createMatrix(dim, dim+1); parameter.setColumn(0, this.conditionalDistribution.getMean() ); parameter.setSubMatrix(0,1, this.conditionalDistribution.getCovariance() ); return parameter; }
public Matrix differentiate( Vector input) { int M = input.getDimensionality(); Matrix dydx = MatrixFactory.getDefault().createMatrix(M, M); for (int i = 0; i < M; i++) { dydx.setElement(i, i, this.getScalarFunction().differentiate(input.getElement(i))); } return dydx; }
public Matrix getMean() { Matrix C = this.inverseWishart.getMean(); Vector mean = this.gaussian.getMean(); final int d = this.getInputDimensionality(); Matrix R = MatrixFactory.getDefault().createMatrix(d, d+1); R.setColumn(0, mean); R.setSubMatrix(0, 1, C); return R; }
public Matrix differentiate( Vector input) { int M = input.getDimensionality(); Matrix dydx = MatrixFactory.getDefault().createMatrix(M, M); for (int i = 0; i < M; i++) { dydx.setElement(i, i, this.getScalarFunction().differentiate(input.getElement(i))); } return dydx; }
/** * Creates a new instance of MultivariateGaussianMeanBayesianEstimator * @param knownCovarianceInverse * Known covariance matrix of the estimated mean. */ public MultivariateGaussianMeanBayesianEstimator( Matrix knownCovarianceInverse ) { this( knownCovarianceInverse, new MultivariateGaussian( VectorFactory.getDefault().createVector(knownCovarianceInverse.getNumRows()), MatrixFactory.getDefault().createIdentity(knownCovarianceInverse.getNumRows(), knownCovarianceInverse.getNumColumns()) ) ); }
/** * Creates a new instance of MultivariateGaussianMeanBayesianEstimator * @param knownCovarianceInverse * Known covariance matrix of the estimated mean. */ public MultivariateGaussianMeanBayesianEstimator( Matrix knownCovarianceInverse ) { this( knownCovarianceInverse, new MultivariateGaussian( VectorFactory.getDefault().createVector(knownCovarianceInverse.getNumRows()), MatrixFactory.getDefault().createIdentity(knownCovarianceInverse.getNumRows(), knownCovarianceInverse.getNumColumns()) ) ); }