ppi_param_tools {scorematchingad}R Documentation

PPI Parameter Tools

Description

The default parameterisation of the PPI model is a symmetric covariance-like matrix ALA_L, a location-like vector bLb_L and a set of Dirichlet exponents β\beta. For p components, ALA_L has p-1 rows, bLb_L is a vector with p-1 elements and β\beta is a vector with p elements. For score matching estimation this form of the parameters must be converted into a single parameter vector using ppi_paramvec(). ppi_paramvec() also includes easy methods to set parameters to NA for estimation with ppi() (in ppi() the NA-valued elements are estimated and all other elements are fixed). The reverse of ppi_paramvec() is ppi_parammats(). An alternative parametrisation of the PPI model uses a single p by p matrix AA^* instead of ALA_L and bLb_L, and for identifiability AA^* is such that 1TA1=01^T A^* 1 = 0 where 1=(1,1,...,1)1=(1,1,...,1) and 0=(0,0,...,0)0=(0,0,..., 0) (Scealy and Wood 2023). Convert between parametrisations using ppi_toAstar() and ppi_fromAstar().

Usage

ppi_paramvec(
  p = NULL,
  AL = NULL,
  bL = NULL,
  Astar = NULL,
  beta = NULL,
  betaL = NULL,
  betap = NULL
)

ppi_parammats(paramvec)

ppi_toAstar(AL, bL)

ppi_fromAstar(Astar)

Arguments

p

The number of components. If NULL then p will be inferred from other inputs.

AL

Either NULL, a p-1 x p-1 symmetric matrix, a number, or "diag". If NULL then all ALA_L elements will be set to NA. If a single number, then ALA_L will be fixed as a matrix of the given value. If "diag" then the non-diagonal elements of ALA_L will be fixed to 0, and the diagonal will be NA.

bL

Either NULL, a number, or a vector of length p-1. If NULL, then all elements of bLb_L will be set to NA. If a single number, then bLb_L will be fixed at the supplied value.

Astar

The AA^* matrix (a p by p symmetric matrix)

beta

Either NULL, a number, or a vector of length p. If NULL then all elements of β\beta will be set to NA. If a single number then the β\beta elements will be fixed at the given number.

betaL

Either NULL, a number, or a vector of length p-1. If NULL then the 1...(p-1)th β\beta elements will be set to NA. If a single number then the 1...(p-1)th β\beta elements will be fixed at the given number.

betap

Either NULL or a number. If NULL then the pth element of β\beta will be set to NA, and ppi() will estimate it. If a number, then the pth element of β\beta will be fixed at the given value.

paramvec

A PPI parameter vector, typically created by ppi_paramvec() or as an output of ppi().

Details

ppi_paramvec() returns a vector starting with the diagonal elements of ALA_L, then the off-diagonal elements extracted by upper.tri() (which extracts elements of ALA_L along each row, left to right, then top to bottom), then bLb_L, then β\beta.

The Astar parametrisation rewrites the PPI density as proportional to

exp(zTAz)i=1pziβi,\exp(z^TA^*z)\prod_{i=1}^p z_i^{\beta_i},

where AA^* (Astar) is a pp by pp matrix. Because zz lies in the simplex (in particular zi=1\sum z_i = 1), the density is the same regardless of the value of 1TA11^T A^* 1=sum(Astar), where 11 is the vector of ones. Thus ALA_L and bLb_L specify AA^* up to an additive factor. In the conversion ppi_toAstar(), AA^* is returned such that 1TA1=01^T A^* 1 = 0. NULL values or NA elements are not allowed for ppi_toAstar() and ppi_fromAstar().

Value

ppi_paramvec(): a vector of length p+(p1)(2+(p1)/2)p + (p-1)(2 + (p-1)/2).

ppi_parammats(): A named list of ALA_L, bLb_L, and β\beta.

ppi_toAstar(): The matrix AA^*.

ppi_fromAstar(): A list of the matrix ALA_L, the vector bLb_L and a discarded constant.

PPI Model

The PPI model density is proportional to

exp(zLTALzL+bLTzL)i=1pziβi,\exp(z_L^TA_Lz_L + b_L^Tz_L)\prod_{i=1}^p z_i^{\beta_i},

where pp is the dimension of a compositional measurement zz, and zLz_L is zz without the final (ppth) component. ALA_L is a p1×p1p-1 \times p-1 symmetric matrix that controls the covariance between components. bLb_L is a p1p-1 vector that controls the location within the simplex. The iith component βi\beta_i of β\beta controls the concentration of density when ziz_i is close to zero: when βi0\beta_i \geq 0 there is no concentration and βi\beta_i is hard to identify; when βi<0\beta_i < 0 then the probability density of the PPI model increases unboundedly as ziz_i approaches zero, with the increasing occuring more rapidly and sharply the closer βi\beta_i is to 1-1.

See Also

Other PPI model tools: dppi(), ppi_robust(), ppi(), rppi()

Examples

ppi_paramvec(AL = "diag", bL = 0, betap = -0.5, p = 3)
vec <- ppi_paramvec(AL = rsymmetricmatrix(2), beta = c(-0.8, -0.7, 0))
ppi_parammats(vec)
Astar <- rWishart(1, 6, diag(3))[,,1]
ppi_fromAstar(Astar)
ppi_toAstar(ppi_fromAstar(Astar)$AL, ppi_fromAstar(Astar)$bL)

[Package scorematchingad version 0.0.67 Index]