Description Usage Arguments Value Examples
It computes the d-dimensional empirical characteristic function
1 |
t |
d-variate vector where the ecf will be evaluated |
samp |
nxd matrix with the n samples |
A complex value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(mvdeconvolution)
library(reshape2)
library(ggplot2)
## Example 1
## Real and imag. parts of exponential dist.
samp <- rexp(60)
t <- seq(-3, 3, len = 150)
vals <- sapply(t, ecf, samp)
real <- Re(vals)
imag <- Im(vals)
## ## Plot values. Uncomment below
## df <- data.frame(t, real, imag)
## df.molten <- melt(df, id = "t")
## head(df.molten)
## qplot(t, value, data = df.molten, geom = 'line',
## facets = . ~ variable)
## Example 2
## Real part of bivariate normal emp. ch. fnc.
samp <- cbind(rnorm(100), rnorm(100))
t1 <- seq(-3, 3, len = 150)
t2 <- t1
t <- expand.grid(t1, t2)
ecf.vals <- apply(t, 1, ecf, samp)
re.vals <- matrix(Re(ecf.vals), 150, 150)
persp(t1, t2, re.vals)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.