Learn R Programming

selectiongain (version 2.0.22)

multistagetp: Function for calculating the truncation point

Description

This function calculates the coordinates of the truncation point Q for given selected fractions A and correlation matrix of X. The R function uniroot in core package stats is called internally to solve the truncation point equations. It is needed for multistagegain function to calculated the expected selection gain.

Usage

multistagetp(alpha,  corr, corx,   alg)

Arguments

alpha
Probability vector $\vec{\alpha}$ for random variable X. In plant breeding, it is also called the selected fraction.
corr
(n+1-dimensional matrix) is the correlation matrix of y and X, which is introduced in function multistagecorr. The correlation matrix must be symmetric and positive-definite. Before starting the calculations, the user is recommended to check the correlati
corx
(n-dimensional matrix) is the correlation matrix of X. The default value is NA.
alg
is used to switch between two algorithms. If alg = GenzBretz(), which is by default, the quasi-Monte Carlo algorithm from Genz (2009) will be used. If alg = Miwa(), the program will use the Miwa algorithm (Mi et. al., 2009), whic

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 alpha vector $\vec{\alpha}={ \alpha_{1},\alpha_{2},...,\alpha_{n} }$. It can be compared with the function qmvnorm() in R-package mvtnorm, which calculates only the equi coordinate quantile $q$ for multi-variate normal distribution from a given alpha scalar.

References

A. Genz and F. Bretz. Computation of Multivariate Normal and t Probabilities. Lecture Notes in Statistics, Vol. 195, Springer-Verlag, Heidelberg, 2009. A. Genz, F. Bretz, T. Miwa, X. Mi, F. Leisch, F. Scheipl and T. Hothorn. mvtnorm: Multivariate normal and t distributions. R package version 0.9-9995, 2013. X. Mi, T. Miwa and T. Hothorn. Implement of Miwa's analytical algorithm of multi-normal distribution, R Journal, 1:37-39, 2009.

See Also

selectiongain(), qnorm()

Examples

Run this code
# first example

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)

# second example

VCGCAandError=c(0.40,0.20,0.20,0.40,2.00)
VCSCA=c(0.20,0.10,0.10,0.20)

corr.matrix = multistagecor (maseff=0.40, VGCAandE=VCGCAandError,
VSCA=VCSCA, T=c(1,1,5), L=c(1,3,8), Rep=c(1,1,1))

N1=4500;N2=919;N3=45;Nf=10

Q=multistagetp(c(N2/N1,N3/N2,Nf/N3),  corr=corr.matrix)

Run the code above in your browser using DataLab