Learn R Programming

polykde (version 1.1.7)

r_g_kern: Sample from the angular kernel density

Description

Simulation from the angular density function of an isotropic kernel on the sphere \(\mathcal{S}^d\).

Usage

r_g_kern(n, d, h, kernel = "1", k = 10)

Value

A vector of size n with the sample.

Arguments

n

sample size.

d

vector of size r with dimensions.

h

vector of size r with bandwidths.

kernel

kernel employed: 1 for von Mises--Fisher (default); 2 for Epanechnikov; 3 for softplus.

k

softplus kernel parameter. Defaults to 10.0.

Examples

Run this code
hist(r_g_kern(n = 1e3, d = 2, h = 1, kernel = "1"), breaks = 30,
     probability = TRUE, main = "", xlim = c(-1, 1))
hist(r_g_kern(n = 1e3, d = 2, h = 1, kernel = "2"), breaks = 30,
     probability = TRUE, main = "", xlim = c(-1, 1))
hist(r_g_kern(n = 1e3, d = 2, h = 1, kernel = "3"), breaks = 30,
     probability = TRUE, main = "", xlim = c(-1, 1))

Run the code above in your browser using DataLab