dWn1D: WN density in 1D

View source: R/RcppExports.R

dWn1DR Documentation

WN density in 1D

Description

Computation of the WN density in 1D.

Usage

dWn1D(x, mu, sigma, maxK = 2L, expTrc = 30, vmApprox = 0L, kt = 0,
  logConstKt = 0)

Arguments

x

a vector of length n containing angles. They all must be in [\pi,\pi) so that the truncated wrapping by maxK windings is able to capture periodicity.

mu

mean parameter. Must be in [\pi,\pi).

sigma

diffusion coefficient.

maxK

maximum absolute value of the windings considered in the computation of the WN.

expTrc

truncation for exponential: exp(x) with x <= -expTrc is set to zero. Defaults to 30.

vmApprox

whether to use the von Mises approximation to a wrapped normal (1) or not (0, default).

kt

concentration for the von Mises, a suitable output from momentMatchWnVm (see examples).

logConstKt

the logarithm of the von Mises normalizing constant associated to the concentration kt (see examples)

Value

A vector of size n containing the density evaluated at x.

Examples

mu <- 0
sigma <- 1
dWn1D(x = seq(-pi, pi, l = 10), mu = mu, sigma = sigma, vmApprox = 0)

# von Mises approximation
kt <- scoreMatchWnVm(sigma2 = sigma^2)
dWn1D(x = seq(-pi, pi, l = 10), mu = mu, sigma = sigma, vmApprox = 1, kt = kt,
      logConstKt = -log(2 * pi * besselI(x = kt, nu = 0, expon.scaled = TRUE)))

sdetorus documentation built on Aug. 21, 2023, 1:08 a.m.

Related to dWn1D in sdetorus...