umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ssj Show documentation
Show all versions of ssj Show documentation
SSJ is a Java library for stochastic simulation, developed under the direction of Pierre L'Ecuyer,
in the Département d'Informatique et de Recherche Opérationnelle (DIRO), at the Université de Montréal.
It provides facilities for generating uniform and nonuniform random variates, computing different
measures related to probability distributions, performing goodness-of-fit tests, applying quasi-Monte
Carlo methods, collecting (elementary) statistics, and programming discrete-event simulations with both
events and processes.
The newest version!
/*
* Class: ContinuousDistributionMulti
* Description: mother class for continuous multidimensional distributions
* Environment: Java
* Software: SSJ
* Copyright (C) 2001 Pierre L'Ecuyer and Université de Montréal
* Organization: DIRO, Université de Montréal
* @author
* @since
* SSJ is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License (GPL) as published by the
* Free Software Foundation, either version 3 of the License, or
* any later version.
* SSJ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* A copy of the GNU General Public License is available at
GPL licence site.
*/
package umontreal.iro.lecuyer.probdistmulti;
import umontreal.iro.lecuyer.util.PrintfFormat;
import umontreal.iro.lecuyer.util.Num;
/**
* Classes implementing continuous multi-dimensional distributions should inherit
* from this class. Such distributions are characterized by a density
* function
* f (x1, x2,…, xd);
* thus the signature of a density method is supplied here.
* All array indices start at 0.
*
*/
public abstract class ContinuousDistributionMulti {
protected int dimension;
/**
* Returns
* f (x1, x2,…, xd), the probability density of
* X evaluated at the point
* x, where
* x = {x1, x2,…, xd}. The convention is that
*
* x [i - 1 ] = xi.
*
* @param x value at which the density is evaluated
*
* @return density function evaluated at x
*
*/
public abstract double density (double[] x);
/**
* Returns the dimension d of the distribution.
*
*/
public int getDimension() {
return dimension;
}
/**
* Returns the mean vector of the distribution, defined as
* μi = E[Xi].
*
*/
public abstract double[] getMean();
/**
* Returns the variance-covariance matrix of the distribution, defined as
*
* σij = E[(Xi - μi)(Xj - μj)].
*
*/
public abstract double[][] getCovariance();
/**
* Returns the correlation matrix of the distribution, defined as
*
* ρij = σij/(σ_iiσ_jj)1/2.
*
*/
public abstract double[][] getCorrelation();
}