Learn R Programming

activity (version 1.0)

rvmkern: Random circular kernel numbers.

Description

Random numbers drawn from a fitted Von Mises kernel distribution.

Usage

rvmkern(n, fit)

Arguments

n
Integer number of numbers to return.
fit
An emprical distribution contained in either a matrix or a fitted actmod object (see Details).

Value

A numeric vector of radian numbers.

Details

If fit is a matrix, it should have two columns: [,1] precisely seq(0,2*pi,pi/256) sequence of radian values at which pdf evaluated; [,2] corresponding pdf values.

Examples

Run this code
#Matrix input
 data(BCItime)
 tm <- 2*pi*BCItime$time[BCItime$species=="paca"]
 xx <- seq(0,2*pi, pi/256)
 rn <- rvmkern(100, cbind(xx, dvmkern(xx, tm)))

 #actmod input
 fit <- fitact(tm, sample="n")
 rvmkern(100,fit)

Run the code above in your browser using DataLab