Simulate Fisher Bingham and related distributions {simdd} | R Documentation |
Simulate Fisher Bingham and related distributions
Description
Simulate the Fisher Bingham distribution on the unit sphere, the matrix Bingham distribution on a Grassmann manifold, the matrix Fisher distribution on SO(3), and the bivariate von Mises sin model on the torus = product of two circles.
Usage
rFisherBingham(nsim, mu = 0, Aplus = 0, q = dimset(mu, Aplus), mtop = 1000)
rBingham(nsim, Aplus, q = dimq(Aplus), mtop = 1000)
rBingham.Grassmann(nsim, Aplus = 0, q = dimq(Aplus), r = 1, mtop = 1000)
rFisher.SO3(nsim, Fmat, mtop = 1000)
rvMsin.torus(nsim, k1, k2, alpha, mtop=1000)
rBessel(nsim, k1, k2, alpha, mtop=1000)
Arguments
nsim |
the desired number of simulations |
mu |
a vector of length |
Aplus |
a symmetric |
q |
The simulation is done on the unit sphere in |
r |
For |
mtop |
The maximum number of attempts to generate |
Fmat |
The 3 by 3 parameter matrix for the matrix Fisher
distribution in the function |
k1 , k2 , alpha |
The two concentration parameters and the
interaction parameter in the function |
Details
The Fisher Bingham distribution on the unit sphere in R^q
has density
proportional to
\exp(\code{mu}^T x + x^T \code{Aplus} x)
where x
is a unit vector in R^q
, and mu
(q
-dimensional vector) and
Aplus
(q
by q
symmetric) are parameters.
The matrix Bingham distribution on q
by r
matrices X
whose columns are
orthonormal, is given by the density proportional to
\exp(trace(X^T \code{Aplus} X)).
The Bingham distribution on the unit sphere in R^q
can be simulated
using (a) rBingham
, (b) rFisherBingham
with mu=0
, and (c)
rBingham.Grassmann
with r=1
. Choice (a) will be fastest.
The Fisher distribution can be simulated using rFisherBingham
with
Aplus=0
.
The matrix Fisher distribution on SO(3) has density proportional to
\exp(trace(\code{Fmat}^T X))
where X is a 3 by 3 rotation matrix, and Fmat
is a 3 by 3 parameter
matrix.
The bivariate von Mises sine model on the torus has density proportional to
\exp(\code{k1} \cos(\theta) + \code{k2} cos(\phi) + \code{alpha} sin(\theta) \sin(\phi))
for two angles \theta
, \phi
. The Bessel density is obtained from the
bivariate von Mises sine model as the marginal density of \theta
.
If mtop
is reached before obtaining nsim
simulations then a warning is created and the returned array will have fewer than nsim
rows.
Value
For rBingham
and rFisherBingham
, the output is an nsim
by q
matrix. Each row is a simulated unit vector.
For rBingham.Grassmann
, the output is an nsim
by q
by r
array. For
each value of the first index, the result is a simulated q
by r
matrix with
orthonormal columns.
For rFisher.SO3
, the output is an nsim
by r
by r
array. For
each value of the first index, the result is a simulated r
by r
matrix
rotation matrix.
For rvMsin.torus
, the output is an nsim
by 4 matrix, with each row
containing the simulated value of (\cos(\theta), \sin(\theta), \cos(\phi),
\sin(\phi))
.
For rBessel
, the output is an nsim
by 2 matrix containing the marginal
simulated values of (\cos(\theta), \sin(\theta))
.
In all cases, the output has an attribute summary
, which is a vector
of length 6 summarizing some details about the number of simulations
needed in the acceptance/rejection algorithm. The key element of this
vector is called efficiency
, a number between 0 and 1, where 1 means
that all the simulated values from the envelope distribution have been
accepted.
-
ntry
is the number of simulations drawn from the envelope distribution. -
efficiency
is the proportion of simulations drawn from the envelope distribution that were accepted. -
success
is1
when simulations were completed, and0
otherwise. Usually the simulations are incomplete because the number of iterations (in entrymloops
) has reached the maximummtop
. -
mloops
is the number of iterations used. -
minfg
is the smallest observed value of the envelope. -
maxfg
is the largest observed value of the envelope.
Author(s)
J T Kent
References
John T. Kent, Asaad M. Ganeiber & Kanti V. Mardia (2018) A New Unified Approach for the Simulation of a Wide Class of Directional Distributions, Journal of Computational and Graphical Statistics, 27:2, 291-301, DOI: doi:10.1080/10618600.2017.1390468
See Also
The function rvm
in the CRAN library CircStats
provides a more
efficient method to simulate from the von Mises distribution (i.e. the
Fisher distribution with q=2) than rFisherBingham
.
Examples
X1=rBingham(10,c(1,2,-3))
attr(X1,"summary")
X2=rFisherBingham(10,c(3,2,1),c(1,2,-3))
X3=rBingham.Grassmann(10,c(1,2,-3),r=2)
X4=rFisher.SO3(10,matrix(c(1,2,3,4,2,1,0,1,2),3,3))
X5=rvMsin.torus(10,2.2,3.1,1.3)
X6=rBessel(10,2.2,3.1,1.3)