Learn R Programming

selectiongain (version 2.0.6)

multistagetp: Function for calculating the truncation point

Description

This function calculates the coordinates of the truncation point Q for given selected fractions alpha. The R function uniroot in core package stats is called internally to solve the truncation point equations.

Usage

multistagetp(alpha, corx, alg)

Arguments

alpha
Probability vector $\vec{\alpha}$, with length n, for random variable X. In other disciplines, such as plant breeding, it is also called the selected fraction.
corx
n-dimensional matrix. It is the correlation matrix of selection indices X. More detail see multistagegain.
alg
An object used to switch between two algorithms. More detail see multistagegain.

Value

  • The out come is a vector for the coordinates.

Details

This function calculates the non-equi coordinate quantile vector $Q={q_{1},q_{2},...,q_{n}}$ for a multivariate normal distribution from a given selection fraction vector $\textbf{A}={ \alpha_{1},\alpha_{2},...,\alpha_{n} }$. It can be compared with the function qmvnorm in package mvtnorm, which calculates the equi-coordinate quantile $q$ for multi-variate normal distribution from a given alpha scalar. The truncation point $\textbf{Q}$ must be calculated from the vector of selected fractions $\textbf{A}$. The coordinates $q_i$ are obtained by inverting the following equations sequentially: $$\alpha_1= f (q_1) =\int_{q_1}^{\infty} \phi_1 (x_1) \, dx_1 \label{equ-alpha1},$$ which yields $q_1$; $$\alpha_1 \alpha_2= f (q_1,q_2) =\int_{q_2}^{\infty} \int_{q_1}^{\infty} \phi_2 (x_1,x_2; \rho_{x_1,x_2})\, dx_1 \,dx_2,$$ which yields $q_2$ for given values of $q_1$, $\alpha_1$ and $\alpha_2$, and so on for $i=3,4,\ldots,n$. Here we have assumed that $\bm{\Sigma}$ is diagonal, so the above inverting function can be simplified into $$\alpha_i=\int_{q_i}^{\infty} \phi_1 (x_i)\, d x_i \label{equ-simple}$$ If $\bm{\Sigma}$ is not diagonal, the value of $q_n$ is finally obtained by using $q_{1},q_{2},\ldots,q_{n-1}$ and $\alpha_{1},\alpha_{2},\ldots,\alpha_{n}$: $$\prod_1^n \alpha_i=\int_{q_n}^{\infty}\int_{q_{n-1}}^{\infty}\ldots\int_{q_1}^{\infty} \phi_n (\bm{X};\bm{\Sigma})\, d \textbf{x} \label{equ-alpha2}$$ These equations can be solved numerically via a fast root search algorithm, which was described for example by Brent (1973) and implemented in the function uniroot, though the function qmvnorm.

References

Brent, R. (1973) Algorithms for Minimization without Derivatives. Prentice-Hall, Englewood Cliffs, New Jersey.

See Also

multistagegain

Examples

Run this code
dim=3
 alpha=rep(0,dim)

 alpha[1] = 0.3333
 alpha[2] = 0.25
 alpha[3] = 0.2

corr=diag(3)

corr12=0.3016
corr[1,2]=corr12
corr[2,1]=corr12

corr13=0.5630
corr[1,3]=corr13
corr[3,1]=corr13

corr23=0.5630
corr[2,3]=corr23
corr[3,2]=corr23

multistagetp(alpha,corx=corr)

Run the code above in your browser using DataLab