multiprobit_utils | R Documentation |
Compute inverse of a Cholesky matrix, storing the result in reverse order, see Details.
tri_solve(A, b, lower_tri = FALSE)
inverse_chol_reverse(Sigma_chol, lower_chol = FALSE)
qchisq_pnorm(x, df)
qnorm_pchisq(x, df)
qbeta_pchisq(x, df, shape1, shape2, ncp)
qchisq_pbeta(x, shape1, shape2, df, ncp)
sparse_identity(d)
Sigma_chol |
Cholesky factor of a covariance matrix |
lower_chol |
|
x |
Probability or quantile |
df |
Degrees of freedom parameter |
shape1 |
Shape parameter for a Beta distribution |
shape2 |
Shape parameter for a Beta distribution |
ncp |
Non-centrality parameter for Beta and |
d |
Matrix dimension |
tri_solve()
solves triangular systems with back/forwardsolve
inverse_chol_reverse()
notes:
For lower_chol == FALSE
,
the input Sigma_chol
is the matrix R
in the Cholesky factorisation
\Sigma=R^T R
with inverse Q=R^{-1}R^{-T}
. Since R^{-1}
has
the opposite upper/lower triangular property to R^T
, this Q
factorisation isn't a regular Cholesky factorisation. Let P
be the
permutation matrix that reverses element order. Then
PQP=PR^{-1}PPR^{-T}P
, and PR^{-T}P
is the Cholesky factor of
PQP
with the same upper/lower triangular property as R
.
For lower_chol == TRUE
, the input is L
in \Sigma=LL^T
and the
output is PL^{-T}P
, with PQP=PL^{-T}PPL^{-1}P
.
qchisq_pnorm()
evaluates qchisq(pnorm(...))
with
attempt at numerical stability.
inverse_chol_reverse()
returns a Cholesky matrix of the same triangle orientation as the input,
with rows and columns in reverse order.
These are internal non-exported function
if(interactive()){
inverse_chol_reverse(matrix(c(1, 0, 2, 3), 2, 2))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.