Package 'empichar'

Title: Evaluates the Empirical Characteristic Function for Multivariate Samples
Description: Evaluates the empirical characteristic function of univariate and multivariate samples. This package uses 'RcppArmadillo' for fast evaluation. It is also possible to export the code to be used in other packages at 'C++' level.
Authors: Guillermo Basulto-Elias [aut, cre]
Maintainer: Guillermo Basulto-Elias <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1
Built: 2024-11-11 07:29:03 UTC
Source: CRAN

Help Index


Empirical characteristic function

Description

Empirical characteristic function of a d-dimensional random variable. This function is evaluated at m vectors of size d.

Usage

ecf(t, smp)

Arguments

t

m x d matrix where the function will be evaluated.

smp

n x d matrix with sample size if size n.

Details

This function must receive matrices or vectors. It is a wrapper function that allows more general inputs.

Value

A complex vector of size m with the empirical characteristic function.

Examples

library(empichar)
t <- seq(-10, 10, 0.05)
X <- rnorm(150, mean = 1)
vals <- ecf(t, X)
plot(t, Re(vals), type = "l", main = "real part")
plot(t, Im(vals), type = "l", main = "imaginary part")

Imaginary part of empirical characteristic function

Description

Imaginary part of empirical characteristic function of a d-dimensional random variable. This function is evaluated at m vectors of size d.

Usage

ecf_imag(t, smp)

Arguments

t

m x d matrix where the function will be evaluated.

smp

n x d matrix with sample size if size n.

Details

This function must receive matrices or vectors. It is a wrapper function that allows more general inputs.

Value

A vector of size m with the imaginary part of the empirical characteristic function.

Examples

library(empichar)
t <- seq(-10, 10, 0.05)
X <- rnorm(150, mean = 1)
vals <- ecf_imag(t, X)
plot(t, vals, type = "l")

Modulus of empirical characteristic function

Description

Modulus of empirical characteristic function of a d-dimensional random variable. This function is evaluated at m vectors of size d.

Usage

ecf_mod(t, smp)

Arguments

t

m x d matrix where the function will be evaluated.

smp

n x d matrix with sample size if size n.

Details

This function must receive matrices or vectors. It is a wrapper function that allows more general inputs.

Value

A vector of size m with the modulus of the empirical characteristic function.

Examples

library(empichar)
t <- seq(-10, 10, 0.05)
X <- rnorm(150)
vals <- ecf_mod(t, X)
plot(t, vals, type = "l")

Real part of empirical characteristic function

Description

Real part of empirical characteristic function of a d-dimensional random variable. This function is evaluated at m vectors of size d.

Usage

ecf_real(t, smp)

Arguments

t

m x d matrix where the function will be evaluated.

smp

n x d matrix with sample size if size n.

Details

This function must receive matrices or vectors. It is a wrapper function that allows more general inputs.

Value

A vector of size m with the real part of the empirical characteristic function.

Examples

library(empichar)
t <- seq(-10, 10, 0.05)
X <- rnorm(150)
vals <- ecf_real(t, X)
plot(t, vals, type = "l")