SSJ
3.3.1
Stochastic Simulation in Java
|
This abstract class defines the algorithms used for NORTA initialization when the marginal distributions are discrete. More...
Public Member Functions | |
NortaInitDisc (double rX, DiscreteDistributionInt dist1, DiscreteDistributionInt dist2, double tr) | |
Constructor with the target rank correlation rX , the two discrete marginals dist1 and dist2 and the parameter for the truncation tr . More... | |
abstract double | computeCorr () |
Computes and returns the correlation \(\rho_Z\). More... | |
void | computeParams () |
Computes the following inputs of each marginal distribution: More... | |
double | integ (double r) |
Computes the function. More... | |
double | deriv (double r) |
Computes the derivative of \(g_r\), given by. More... | |
String | toString () |
Protected Attributes | |
double | rX |
DiscreteDistributionInt | dist1 |
DiscreteDistributionInt | dist2 |
double | tr |
double | mu1 |
Package Attributes | |
double | mu2 |
double | sd1 |
double | sd2 |
int | m2 |
This abstract class defines the algorithms used for NORTA initialization when the marginal distributions are discrete.
Four algorithms are supported for now, and they are defined as subclasses of the class NortaInitDisc
.
For two random variables \(X_1\) and \(X_2\), and their two marginal distributions \(F_1\) and \(F_2\), respectively, we specify the rank correlation \(r_X=\mbox{Corr}(F_1(X_1),F_2(X_2))\), the parameters of the marginal distributions and a parameter for truncation \(tr\). For the correlation matching, we must have finite supports for the two distributions. Then if the support of each marginal is infinite, we have to upper-bound it at the quantile of order \(tr\). For example, if the marginals have their support points in \([0,+\infty)\), the software will truncate to \([0,F_l^{-1}(tr)]\), for \(l=1,2\). The parameter \(tr\) must to be given by the user, depending on the type of the two distributions. If the marginals have finite supports, one can simply give \(tr=1\).
Each algorithm NI1, NI2a, NI2b and NI3 can be used to calculate the corresponding correlation \(\rho_Z=\mbox{Corr}(Z_1,Z_2)\), where \(Z_1\) and \(Z_2\) are standard normal random variables. These subclasses implement the specific methods for NORTA initialization presented in [13] .
Each type of algorithm should be defined as a subclass of NortaInitDisc. Each subclass must implement the method computeCorr which returns the solution \(\rho_Z\). When executing this method, the subclass may call the methods integ and deriv, depending on the type of algorithm. For example, the subclass NI1 calls only the method integ, since the algorithm do not use the derivative [13] . Each subclass must also call the method computeParams(,) which is executed immediately before the beginning of the root-finder algorithm.
When creating a class representing an algorithm, the #toString method can be called to display information about the inputs.
NortaInitDisc | ( | double | rX, |
DiscreteDistributionInt | dist1, | ||
DiscreteDistributionInt | dist2, | ||
double | tr | ||
) |
Constructor with the target rank correlation rX
, the two discrete marginals dist1
and dist2
and the parameter for the truncation tr
.
This constructor can be called only by the constructors of the subclasses.
|
abstract |
Computes and returns the correlation \(\rho_Z\).
Every subclass of NortaInitDisc must implement this method.
void computeParams | ( | ) |
Computes the following inputs of each marginal distribution:
Every subclass of NortaInitDisc must call this method.
double deriv | ( | double | r | ) |
Computes the derivative of \(g_r\), given by.
\begin{align} \tag{grp_M} g’_r(r)=\sum_{i=0}^{m_1-2} p_{1,i+1} \sum_{j=0}^{m_2-2} p_{2,j+1} \phi_r(z_{1,i },z_{2,j}), \end{align}
where \(\phi_r\) is the bivariate standard binormal density. The method uses \(m_1\), \(m_2\), and the vectors \(p_1[i], i=1,…,m_1-1\); \(z_1[i], i=0,…,m_1-2\); \(p_2[j], j=1,…,m_2-1\); \(z_2[j], j=0,…,m_2-2\). The correlation parameter \(r\) must be in \([-1,1]\). This method may be called by subclasses of NortaInitDisc.
r | initial value of the correlation |
double integ | ( | double | r | ) |
Computes the function.
\begin{align} \tag{gr_M} g_r(r)=\sum_{i=0}^{m_1-2} p_{1,i+1} \sum_{j=0}^{m_2-2} p_{2,j+1} \bar{\Phi}_r(z_{1,i },z_{2,j}), \end{align}
which involves the bivariate normal integral \( \bar{\Phi}_r(x,y)= \int_x^{\infty}\int_y^{\infty}\phi_r(z_1,z_2) dz_1 dz_2\). Method #barF of class umontreal.ssj.probdistmulti.BiNormalDonnellyDist (from package probdistmulti of SSJ [155] ) is used to compute \(\bar{\Phi}_r(x,y)\), with \(m_1\), \(m_2\), and the vectors \(p_1[i], i=1,…,m_1-1\); \(z_1[i], i=0,…,m_1-2\); \(p_2[j], j=1,…,m_2-1\); \(z_2[j], j=0,…,m_2-2\). The correlation parameter \(r\) must be in \([-1,1]\). This method may be called by subclasses of NortaInitDisc.
r | initial value of the correlation |