/** * Learns a normalization based on a mean and full covariance matrix from * the given data. * * @param values * The values to learn the decorrelator from. * @param defaultCovariance * The default value for the covariance. Added to the diagonal of the * covariance matrix to prevent singular values. * @return * The MultivariateDecorrelator created from the multivariate mean and * variance. */ public static MultivariateDecorrelator learnFullCovariance( final Collection<? extends Vectorizable> values, final double defaultCovariance) { // Convert the values to vector form. final Collection<Vector> vectorValues = DatasetUtil.asVectorCollection(values); // Learn the maximum likelihood estimator of the Gaussian. final MultivariateGaussian.PDF pdf = MultivariateGaussian.MaximumLikelihoodEstimator.learn( vectorValues, defaultCovariance); return new MultivariateDecorrelator(pdf); }
/** * Learns a normalization based on a mean and full covariance matrix from * the given data. * * @param values * The values to learn the decorrelator from. * @param defaultCovariance * The default value for the covariance. Added to the diagonal of the * covariance matrix to prevent singular values. * @return * The MultivariateDecorrelator created from the multivariate mean and * variance. */ public static MultivariateDecorrelator learnFullCovariance( final Collection<? extends Vectorizable> values, final double defaultCovariance) { // Convert the values to vector form. final Collection<Vector> vectorValues = DatasetUtil.asVectorCollection(values); // Learn the maximum likelihood estimator of the Gaussian. final MultivariateGaussian.PDF pdf = MultivariateGaussian.MaximumLikelihoodEstimator.learn( vectorValues, defaultCovariance); return new MultivariateDecorrelator(pdf); }
/** * Learns a normalization based on a mean and full covariance matrix from * the given data. * * @param values * The values to learn the decorrelator from. * @param defaultCovariance * The default value for the covariance. Added to the diagonal of the * covariance matrix to prevent singular values. * @return * The MultivariateDecorrelator created from the multivariate mean and * variance. */ public static MultivariateDecorrelator learnFullCovariance( final Collection<? extends Vectorizable> values, final double defaultCovariance) { // Convert the values to vector form. final Collection<Vector> vectorValues = DatasetUtil.asVectorCollection(values); // Learn the maximum likelihood estimator of the Gaussian. final MultivariateGaussian.PDF pdf = MultivariateGaussian.MaximumLikelihoodEstimator.learn( vectorValues, defaultCovariance); return new MultivariateDecorrelator(pdf); }