ellips_rbichibarsq generates an n by 2 matrix such that the rows form iid samples from the bivariate chi-bar-squared distribution of an ellipsoidal cone.

ellips_rbichibarsq(n, A, semiax = TRUE)

Arguments

n

number of samples

A

invertible matrix or positive vector

semiax

logical; if TRUE, the algorithm will first compute the lengths of the semiaxes of the cone

Value

If A is an invertible matrix and reduce==TRUE (default), then the output of ellips_rbichibarsq_gen(n,A) is a list containing the following elements:

  • semiax: a vector of the lengths of the semiaxes of the ellipsoidal cone defined by the matrix A,

  • samples: an n by 2 matrix whose rows form iid samples from the bivariate chi-bar-squared distribution with weights given by the intrinsic volumes of the ellipsoidal cone A*L, where L={x in R^d | sqrt(2)*x_d >= ||x||}.

If A is a positive vector or reduce==FALSE then the output is only an n by 2 matrix whose rows form iid samples from the bivariate chi-bar-squared distribution with weights given by the intrinsic volumes of the ellipsoidal cone A*L, or diag(c(A,1))*L, depending on whether A is an invertible matrix or a positive vector.

Note

See this vignette for further info.

See also

ellips_semiax

Package: conivol

Examples

A <- matrix(c(2,3,5,7,11,13,17,19,23),3,3) ellips_rbichibarsq(10,A)
#> $semiax #> [1] 0.10984660 0.03065619 #> #> $samples #> [,1] [,2] #> [1,] 1.866971e+00 0.4438067 #> [2,] 1.217929e-09 11.5497990 #> [3,] 2.008307e-15 1.9390846 #> [4,] 2.512705e-16 1.2440809 #> [5,] 1.285011e-01 2.6759243 #> [6,] 7.531005e-01 6.8951578 #> [7,] 5.853156e-01 2.8903316 #> [8,] 8.266022e-17 2.3395360 #> [9,] 5.230057e-17 4.0523531 #> [10,] 1.729975e+00 0.9187464 #>
# the lengths of the semiaxes (directly): ellips_semiax(A)
#> [1] 0.10984660 0.03065619
# sampling without computing semiaxes first: ellips_rbichibarsq(10,A,FALSE)
#> [,1] [,2] #> [1,] 4.799038e+00 8.8954255 #> [2,] 5.493245e-01 6.6128072 #> [3,] 1.154104e+00 2.6443993 #> [4,] 5.103843e+00 1.2669355 #> [5,] 2.395366e-02 1.8350084 #> [6,] 4.526413e+00 1.1080367 #> [7,] 4.663691e-17 0.7709098 #> [8,] 4.389262e-16 4.5506218 #> [9,] 3.496835e-01 0.4528305 #> [10,] 7.067711e-16 0.6698446