/** * Sets vector to a random value based upon a zero-mean multivariate Gaussian distribution with * covariance 'cov'. If repeat calls are made to this class, consider using {@link CovarianceRandomDraw} instead. * * @param cov The distirbutions covariance. Not modified. * @param vector The random vector. Modified. * @param rand Random number generator. */ public static void randomVector( DenseMatrix64F cov , DenseMatrix64F vector , Random rand ) { CovarianceRandomDraw rng = new CovarianceRandomDraw(rand,cov); rng.next(vector); } }
/** * Sets vector to a random value based upon a zero-mean multivariate Gaussian distribution with * covariance 'cov'. If repeat calls are made to this class, consider using {@link CovarianceRandomDraw} instead. * * @param cov The distirbutions covariance. Not modified. * @param vector The random vector. Modified. * @param rand Random number generator. */ public static void randomVector( DenseMatrix64F cov , DenseMatrix64F vector , Random rand ) { CovarianceRandomDraw rng = new CovarianceRandomDraw(rand,cov); rng.next(vector); } }
/** * Sets vector to a random value based upon a zero-mean multivariate Gaussian distribution with * covariance 'cov'. If repeat calls are made to this class, consider using {@link CovarianceRandomDraw} instead. * * @param cov The distirbutions covariance. Not modified. * @param vector The random vector. Modified. * @param rand Random number generator. */ public static void randomVector( DenseMatrix64F cov , DenseMatrix64F vector , Random rand ) { CovarianceRandomDraw rng = new CovarianceRandomDraw(rand,cov); rng.next(vector); } }
/** * <p> * Creates a new vector which is drawn from a multivariate normal distribution with zero mean * and the provided covariance. * </p> * * @see CovarianceRandomDraw * * @param covariance Covariance of the multivariate normal distribution * @return Vector randomly drawn from the distribution */ public static SimpleMatrix randomNormal( SimpleMatrix covariance , Random random ) { CovarianceRandomDraw draw = new CovarianceRandomDraw(random,covariance.getMatrix()); SimpleMatrix found = new SimpleMatrix(covariance.numRows(),1); draw.next(found.getMatrix()); return found; }