Simulation of random values from some circular distributions | R Documentation |

Simulation of random values from some circular distributions.

rvonmises(n, m, k, rads = TRUE) rwrapcauchy(n, m, rho, rads = TRUE) rspml(n, mu, rads = TRUE) rcircbeta(n, m, a, b, rads = TRUE)

`n` |
The sample size. |

`m` |
The mean angle expressed in radians or degrees. |

`mu` |
The mean vector of the SPML in |

`k` |
The concentration parameter of the von Mises distribution. If k is zero the sample will be generated from the uniform distribution over |

`rho` |
The |

`a` |
The |

`b` |
The |

`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. |

For the von Mises distribution, the mean direction is transformed to the Euclidean coordinates (i.e. unit vector) and then the rvmf 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.

For the wrapped Cauchy distribution the function generates Cauchy values *x* and then wrapps around the circle *x = x(mod 2 π)*. For the circular beta the function has some extra steps (see Zheng Sun's master thesis).

A vector with the simulated data.

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Giorgos Athineou <gioathineou@gmail.com>

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

Zheng Sun (2006). Comparing measures of fit for circular distributions. Master thesis, University of Victoria. https://dspace.library.uvic.ca/bitstream/handle/1828/2698/zhengsun_master_thesis.pdf;sequence=1

Lai, M. (1994). Some results in the statistical analysis of directional data. Master thesis, University of Hong Kong.

Presnell Brett, Morrison Scott P. and Littell Ramon C. (1998). Projected multivariate linear models for directional data. Journal of the American Statistical Association, 93(443): 1068-1077.

```
circ.summary, rvmf, racg
```

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.