Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jmat.data
Class RandomMatrix  view RandomMatrix download RandomMatrix.java

java.lang.Object
  extended byjmat.data.Matrix
      extended byjmat.data.RandomMatrix
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class RandomMatrix
extends Matrix

The RandomMatrix Class provides tools for statistical simulations,it extends the Matrix Class and adds many methods.

Version:
2.0

Field Summary
private  boolean isSample
          Is the RandomMatrix a sample or an overal population?
 
Fields inherited from class jmat.data.Matrix
A, m, n
 
Constructor Summary
RandomMatrix(int m, int n)
          Construct an m-by-n matrix of 0.
RandomMatrix(Matrix M)
          Construct a RandomMatrix from a Matrix (conversion).
 
Method Summary
static RandomMatrix beta(int m, int n, double a, double b)
          Construct an m-by-n matrix of random numbers from a Beta random variable.
static RandomMatrix bootstrap(int m, int n, RandomMatrix sample)
          Construct an m-by-n matrix of random numbers from a sample of this random variable, using the BOOTSTRAP technic.
static RandomMatrix cauchy(int m, int n, double mu, double sigma)
          Construct an m-by-n matrix of random numbers from a Cauchy random variable.
 Matrix cor()
          Generate a correlation matrix, each column contains values of a pulling.
 Matrix corColumns()
          Generate a correlation matrix, each row contains values of a pulling.
 Matrix corRows()
          Generate a correlation matrix, each column contains values of a pulling.
 Matrix cov()
          Generate a covariance matrix, each column contains values of a pulling.
 Matrix covColumns()
          Generate a covariance matrix, each row contains values of a pulling.
 Matrix covRows()
          Generate a covariance matrix, each column contains values of a pulling.
static RandomMatrix dirac(int m, int n, Matrix val_prob)
          Construct an m-by-n matrix of random numbers from a discrete random variable.
static RandomMatrix exponential(int m, int n, double lambda)
          Construct an m-by-n matrix of random numbers from an exponantial random variable.
static RandomMatrix logNormal(int m, int n, double mu, double sigma)
          Construct an m-by-n matrix of random numbers from a LogNormal random variable.
 Matrix mean()
          Generate a row matrix, each column contents the mean value of the columns.
 Matrix meanColumns()
          Generate a column matrix, each line contents the mean value of the lines.
 Matrix meanRows()
          Generate a row matrix, each column contents the mean value of the columns.
static RandomMatrix normal(int m, int n, double mu, double sigma)
          Construct an m-by-n matrix of random numbers from a Gaussian (Normal) random variable.
static RandomMatrix rejection(int m, int n, jmat.function.DoubleFunction fun, double min, double max)
          Construct an m-by-n matrix of random numbers from a random variable definied by its density methodName, using the rejection technic.
static RandomMatrix sampleWithoutReplacement(int m, int n, Matrix B)
          Construct a sample without replacement of a matrix.
static RandomMatrix sampleWithReplacement(int m, int n, Matrix B)
          Construct a sample with replacement of a matrix.
 void setIsSample(boolean is)
          Specify if the RandomMatrix is a sample of an overall population, or if it's an overall population.
static RandomMatrix shuffle(Matrix B)
          Construct shuffled copy of a matrix.
 jmat.io.gui.MatrixHist2D toFrameHist2D(java.lang.String title, int slices)
          Plot the histogram of the Matrix Columns in a JFrame
 jmat.io.gui.MatrixHist3D toFrameHist3D(java.lang.String title, int slicesX, int slicesY)
          Plot the histogram of the Matrix Columns in a JFrame
 jmat.io.gui.MatrixHist2D toPanelHist2D(int slices)
          Plot the histogram of the Matrix Columns in a JPanel
 jmat.io.gui.MatrixHist3D toPanelHist3D(int slicesX, int slicesY)
          Plot the histogram of the Matrix Columns in a JPanel
static RandomMatrix triangular(int m, int n, double min, double max)
          Construct an m-by-n matrix of random numbers from a symetric triangular random variable.
static RandomMatrix triangular(int m, int n, double min, double med, double max)
          Construct an m-by-n matrix of random numbers from a non-symetric triangular random variable.
static RandomMatrix uniform(int m, int n, double min, double max)
          Construct an m-by-n matrix of random numbers from a uniform random variable.
 Matrix var()
          Generate a variance matrix, each column contains values of a pulling.
 Matrix varColumns()
          Generate a variance matrix, each row contains values of a pulling.
 Matrix varRows()
          Generate a variance matrix, each column contains values of a pulling.
static RandomMatrix weibull(int m, int n, double lambda, double c)
          Construct an m-by-n matrix of random numbers from a Weibull random variable.
 
Methods inherited from class jmat.data.Matrix
checkColumnDimension, checkColumnDimension, checkIndicesDimensions, checkIndicesLengths, checkMatrixDimensions, checkMatrixDimensions, checkRowDimension, checkRowDimension, chol, clone, cond, copy, det, diag, diag, dist, distColumns, distRows, divide, divide, ebeAbs, ebeCos, ebeDivide, ebeDivide, ebeExp, ebeFun, ebeIndFun, ebeInv, ebeLog, ebeMinus, ebePlus, ebePow, ebePow, ebeSin, ebeSqrt, ebeTimes, ebeTimes, eig, find, find, findMatrix, findMatrix, fromFile, fromFile, fromMMLElement, fromMMLFile, fromString, get, get, get, getArray, getArrayCopy, getColumn, getColumnArrayCopy, getColumnDimension, getColumnPackedCopy, getColumns, getMatrix, getRow, getRowArrayCopy, getRowDimension, getRowPackedCopy, getRows, identity, increment, incrementColumns, incrementRows, inverse, lu, max, maxColumns, maxRows, merge, merge, mergeColumns, mergeColumns, mergeRows, mergeRows, min, minColumns, minRows, minus, norm1, norm2, normF, normInf, plus, prod, prodColumns, prodRows, qr, random, rank, reshape, reshapeColumns, reshapeRows, resize, set, set, setColumn, setColumns, setMatrix, setMatrix, setMatrix, setMatrix, setRow, setRows, solve, sort, sortColumns, sortedColumnsMatrix, sortedMatrix, sortedRowsMatrix, sortRows, sum, sumColumns, sumRows, svd, times, times, toCommandLine, toFile, toFile, toFramePlot2D, toFramePlot2D, toFramePlot3D, toFramePlot3D, toFrameTable, toMMLElement, toMMLFile, toPanelPlot2D, toPanelPlot2D, toPanelPlot3D, toPanelPlot3D, toPanelTable, toString, trace, transpose, uminus
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isSample

private boolean isSample
Is the RandomMatrix a sample or an overal population?

Constructor Detail

RandomMatrix

public RandomMatrix(int m,
                    int n)
Construct an m-by-n matrix of 0.


RandomMatrix

public RandomMatrix(Matrix M)
Construct a RandomMatrix from a Matrix (conversion).

Method Detail

beta

public static RandomMatrix beta(int m,
                                int n,
                                double a,
                                double b)
Construct an m-by-n matrix of random numbers from a Beta random variable.


bootstrap

public static RandomMatrix bootstrap(int m,
                                     int n,
                                     RandomMatrix sample)
Construct an m-by-n matrix of random numbers from a sample of this random variable, using the BOOTSTRAP technic.


cauchy

public static RandomMatrix cauchy(int m,
                                  int n,
                                  double mu,
                                  double sigma)
Construct an m-by-n matrix of random numbers from a Cauchy random variable.


dirac

public static RandomMatrix dirac(int m,
                                 int n,
                                 Matrix val_prob)
Construct an m-by-n matrix of random numbers from a discrete random variable.


exponential

public static RandomMatrix exponential(int m,
                                       int n,
                                       double lambda)
Construct an m-by-n matrix of random numbers from an exponantial random variable.


logNormal

public static RandomMatrix logNormal(int m,
                                     int n,
                                     double mu,
                                     double sigma)
Construct an m-by-n matrix of random numbers from a LogNormal random variable.


normal

public static RandomMatrix normal(int m,
                                  int n,
                                  double mu,
                                  double sigma)
Construct an m-by-n matrix of random numbers from a Gaussian (Normal) random variable.


rejection

public static RandomMatrix rejection(int m,
                                     int n,
                                     jmat.function.DoubleFunction fun,
                                     double min,
                                     double max)
Construct an m-by-n matrix of random numbers from a random variable definied by its density methodName, using the rejection technic. ! WARNING : this simulation technic can take a very long time !


sampleWithReplacement

public static RandomMatrix sampleWithReplacement(int m,
                                                 int n,
                                                 Matrix B)
Construct a sample with replacement of a matrix.


sampleWithoutReplacement

public static RandomMatrix sampleWithoutReplacement(int m,
                                                    int n,
                                                    Matrix B)
Construct a sample without replacement of a matrix.


shuffle

public static RandomMatrix shuffle(Matrix B)
Construct shuffled copy of a matrix.


triangular

public static RandomMatrix triangular(int m,
                                      int n,
                                      double min,
                                      double max)
Construct an m-by-n matrix of random numbers from a symetric triangular random variable.


triangular

public static RandomMatrix triangular(int m,
                                      int n,
                                      double min,
                                      double med,
                                      double max)
Construct an m-by-n matrix of random numbers from a non-symetric triangular random variable.


uniform

public static RandomMatrix uniform(int m,
                                   int n,
                                   double min,
                                   double max)
Construct an m-by-n matrix of random numbers from a uniform random variable.


weibull

public static RandomMatrix weibull(int m,
                                   int n,
                                   double lambda,
                                   double c)
Construct an m-by-n matrix of random numbers from a Weibull random variable.


setIsSample

public void setIsSample(boolean is)
Specify if the RandomMatrix is a sample of an overall population, or if it's an overall population. This information is needed to calculate unbiaised estimtors of variance for instance.


cor

public Matrix cor()
Generate a correlation matrix, each column contains values of a pulling.


corColumns

public Matrix corColumns()
Generate a correlation matrix, each row contains values of a pulling.


corRows

public Matrix corRows()
Generate a correlation matrix, each column contains values of a pulling.


cov

public Matrix cov()
Generate a covariance matrix, each column contains values of a pulling.


covColumns

public Matrix covColumns()
Generate a covariance matrix, each row contains values of a pulling.


covRows

public Matrix covRows()
Generate a covariance matrix, each column contains values of a pulling.


mean

public Matrix mean()
Generate a row matrix, each column contents the mean value of the columns.


meanColumns

public Matrix meanColumns()
Generate a column matrix, each line contents the mean value of the lines.


meanRows

public Matrix meanRows()
Generate a row matrix, each column contents the mean value of the columns.


toFrameHist2D

public jmat.io.gui.MatrixHist2D toFrameHist2D(java.lang.String title,
                                              int slices)
Plot the histogram of the Matrix Columns in a JFrame


toFrameHist3D

public jmat.io.gui.MatrixHist3D toFrameHist3D(java.lang.String title,
                                              int slicesX,
                                              int slicesY)
Plot the histogram of the Matrix Columns in a JFrame


toPanelHist2D

public jmat.io.gui.MatrixHist2D toPanelHist2D(int slices)
Plot the histogram of the Matrix Columns in a JPanel


toPanelHist3D

public jmat.io.gui.MatrixHist3D toPanelHist3D(int slicesX,
                                              int slicesY)
Plot the histogram of the Matrix Columns in a JPanel


var

public Matrix var()
Generate a variance matrix, each column contains values of a pulling.


varColumns

public Matrix varColumns()
Generate a variance matrix, each row contains values of a pulling.


varRows

public Matrix varRows()
Generate a variance matrix, each column contains values of a pulling.