Learn R Programming

SOPIE (version 1.4)

von_mises_sim: Generates Simulated Data from a Von Mises Distribution with Noise

Description

Generates simulated data over the interval $[0; 1]$ from a scaled Von Mises distribution with noise.

Usage

von_mises_sim(n = 5000, k = 1, c = 0.3, noise = 0.2)

Arguments

n
number of random variates in the simulated data set.
k
concentration parameter $\kappa$ of the Von Mises distribution.
c
the point of truncation of the Von Mises distribution. The value of c represent that value in the interval $[0; c]$ and $[1-c; 1]$ where the Von Mises density is remove, i.e. $f(\theta) = 0$ for $\theta \in [0 ; c]$ and $\theta \in [1-c ; 1]$ where $f(\
noise
proportion of random noise to include in the simulated data set. If n random variates are required, then $\lfloor (1-noise)n \rfloor$ values are generated from the Von Mises density and the remainder from an uniform density.

Value

  • The output vector of this function is $n$ random variates in the interval $[0; 1]$ from a scaled Von Mises density with uniform noise proportional to noise.

References

Robert CP, Casella G (2010). Introducing Monte Carlo methods with R. Springer. Schutte WD (2014). Nonparametric estimation of the off-pulse interval(s) of a pulsar light curve. Ph.D. thesis, North-West University. URL http://hdl.handle.net/10394/12199

Examples

Run this code
set.seed(777)
simdata<-von_mises_sim(n=5000,k=1,c=0.3,noise=0.2)
hist(simdata)
SOPIE(simdata,h=1,to=1,alpha=0.05,g=5,r=10,m=1,grid=100)

Run the code above in your browser using DataLab