dmig {mig} | R Documentation |
Multivariate inverse Gaussian distribution
Description
The density of the MIG model is
f(\boldsymbol{x}+\boldsymbol{a}) =(2\pi)^{-d/2}\boldsymbol{\beta}^{\top}\boldsymbol{\xi}|\boldsymbol{\Omega}|^{-1/2}(\boldsymbol{\beta}^{\top}\boldsymbol{x})^{-(1+d/2)}\exp\left\{-\frac{(\boldsymbol{x}-\boldsymbol{\xi})^{\top}\boldsymbol{\Omega}^{-1}(\boldsymbol{x}-\boldsymbol{\xi})}{2\boldsymbol{\beta}^{\top}\boldsymbol{x}}\right\}
for points in the d
-dimensional half-space \{\boldsymbol{x} \in \mathbb{R}^d: \boldsymbol{\beta}^{\top}(\boldsymbol{x}-\boldsymbol{a}) \geq 0\}
Usage
dmig(x, xi, Omega, beta, shift, log = FALSE)
rmig(n, xi, Omega, beta, shift, method = c("invsim", "bm"), timeinc = 0.001)
pmig(q, xi, Omega, beta, log = FALSE, method = c("sov", "mc"), B = 10000L)
Arguments
x |
|
xi |
|
Omega |
|
beta |
|
shift |
|
log |
logical; if |
n |
number of observations |
method |
string; one of inverse system ( |
timeinc |
time increment for multivariate simulation algorithm based on the hitting time of Brownian motion, default to |
q |
|
B |
number of Monte Carlo replications for the SOV estimator |
Details
Observations are generated using the representation as the first hitting time of a hyperplane of a correlated Brownian motion.
Value
for dmig
, the (log)-density
for rmig
, an n
vector if d=1
(univariate) or an n
by d
matrix if d > 1
an n
vector of (log) probabilities
Author(s)
Frederic Ouimet (bm
), Leo Belzile (invsim
)
Leo Belzile
Examples
# Density evaluation
x <- rbind(c(1, 2), c(2,3), c(0,-1))
beta <- c(1, 0)
xi <- c(1, 1)
Omega <- matrix(c(2, -1, -1, 2), nrow = 2, ncol = 2)
dmig(x, xi = xi, Omega = Omega, beta = beta)
# Random number generation
d <- 5L
beta <- runif(d)
xi <- rexp(d)
Omega <- matrix(0.5, d, d) + diag(d)
samp <- rmig(n = 1000, beta = beta, xi = xi, Omega = Omega)
mle <- fit_mig(samp, beta = beta, method = "mle")
set.seed(1234)
d <- 2L
beta <- runif(d)
Omega <- rWishart(n = 1, df = 2*d, Sigma = matrix(0.5, d, d) + diag(d))[,,1]
xi <- rexp(d)
q <- mig::rmig(n = 10, beta = beta, Omega = Omega, xi = xi)
pmig(q, xi = xi, beta = beta, Omega = Omega)