Learn R Programming

PartialNetwork (version 1.1.2)

dvMF: Density function of the von Mises-Fisher distribution

Description

Density function for the von Mises-Fisher distribution of dimension p with location parameter equal to mu and intensity parameter eta.

Usage

dvMF(z, theta, log.p = FALSE)

Value

the densities computed at each point.

Arguments

z

is a matrix where each row is a spherical coordinate at which the density will be evaluated.

theta

is a vector of dimension p equal to \(\eta\mu\), where \(\eta\) is the concentration parameter, and \(\mu\) the location parameter.

log.p

is logical; if TRUE, probabilities p are given as log(p).

Examples

Run this code
# Draw 1000 vectors from vMF with parameter eta = 1 and mu = c(1,0)
z <- rvMF(1000, c(1,0))

# Compute the density at z
dvMF(z, c(1,0))

# Density of c(0, 1, 0, 0) with the parameter eta = 3 and mu = c(0, 1, 0, 0)
dvMF(matrix(c(0, 1, 0, 0), nrow = 1), c(0, 3, 0, 0))

Run the code above in your browser using DataLab