Last data update: 2014.03.03

R: Random values simulation from a von Mises-Fisher distribution
rvonmisesR Documentation

Random values simulation from a von Mises-Fisher distribution

Description

It generates random vectors following the von Mises-Fisher distribution. The data can be spherical or hyper-spherical.

Usage

rvonmises(n, m, k, rads = TRUE)

Arguments

n

The sample size.

m

The mean angle expressed in radians or degrees.

k

The concentration parameter. If k is zero the sample will be generated from the uniform distribution over (0, 2π).

rads

If the mean angle is expressed in radians, this should be TRUE and FALSE otherwise. The simulated data will be expressed in radians or degrees depending on what the mean angle is expressed.

Details

The mean direction is transformed to the Euclidean coordinates (i.e. unit vector) and then the fvmf function is employed. It uses a rejection smapling as suggested by Andrew Wood in 1994. I have mentioned the description of the algorithm as I found it in Dhillon and Sra in 2003. Finally, the data are transformed to radians or degrees.

Value

A vector with the simulated data.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr> and Giorgos Athineou <athineou@csd.uoc.gr>

References

Wood, A. T. (1994). Simulation of the von Mises Fisher distribution. Communications in statistics-simulation and computation, 23(1): 157-164. Dhillon, I. S., & Sra, S. (2003). Modeling data using directional distributions. Technical Report TR-03-06, Department of Computer Sciences, The University of Texas at Austin. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.75.4122&rep=rep1&type=pdf

See Also

circ.summary, rvmf

Examples

x <- rvonmises(100, 2, 25, rads = TRUE)
circ.summary(x, rads = TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Directional)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Directional/rvonmises.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rvonmises
> ### Title: Random values simulation from a von Mises-Fisher distribution
> ### Aliases: rvonmises
> ### Keywords: Random values simulation von Mises-Fisher distribution
> 
> ### ** Examples
> 
> x <- rvonmises(100, 2, 25, rads = TRUE)
> circ.summary(x, rads = TRUE)
$mesos
[1] 2.036679

$confint
[1] 2.035192 2.038165

$kappa
[1] 18.79698

$MRL
[1] 0.9730256

$circvariance
[1] 0.0269744

$circstd
[1] 0.2338585

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>