multistagetp: Function for calculating the truncation points

multistagetpR Documentation

Function for calculating the truncation points

Description

This function calculates the coordinates of the truncation points Q for given selected fractions \vec{α}=\{ α_{1},α_{2},...,α_{n} \} and correlation matrix of X. The R function uniroot in core package stats is called internally to solve the truncation point equations.

Usage

multistagetp(alpha,  corr,  alg)

Arguments

alpha

is probability vector \vec{α} for random variable X. In plant breeding, it is also called the selected fraction.

corr

is the correlation matrix of y and X, which is introduced in the function multistagecorr. The correlation matrix must be symmetric and positive-definite. If the estimated correlation matrix is negative-definite, it must be adjusted before using this function. Before starting the calculations, it is recommended to check the correlation matrix.

alg

is used to switch between two algorithms. If alg = GenzBretz(), which is by default, the quasi-Monte Carlo algorithm from Genz et al. (2009, 2013), will be used. If alg = Miwa(), the program will use the Miwa algorithm (Mi et al., 2009), which is an analytical solution of the MVN integral. Miwa's algorithm has higher accuracy (7 digits) than quasi-Monte Carlo algorithm (5 digits). However, its computational speed is slower. We recommend to use the Miwa algorithm.

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 \vec{α}. 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 \vec{α}. The function multistagetp is used by function mulistagegain to calculate the expected gain.

Value

The output is a vector of the coordinates.

Note

When a \vec{α} is given, the quantiles are calculated consecutively to satisfy the given \vec{α}. The calculation from other direction to -∞ of the integral is also possible for qmvnorm().

Author(s)

Xuefei Mi

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


# first 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)


selectiongain documentation built on Sept. 17, 2022, 5:05 p.m.