Description Usage Arguments Value Author(s) Examples
C++ implementation of multivariate Normal probability density function for multiple inputs
1 |
x |
data matrix of dimension |
xi |
mean vectors matrix of dimension |
psi |
skew parameter vectors matrix of dimension |
sigma |
list of length |
df |
vector of length K of degree of freedom parameters. |
Log |
logical flag for returning the log of the probability density
function. Defaults is |
matrix of densities of dimension K x n
.
Boris Hejblum
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | mmvstpdfC(x = matrix(c(3.399890,-5.936962), ncol=1), xi=matrix(c(0.2528859,-2.4234067)),
psi=matrix(c(11.20536,-12.51052), ncol=1),
sigma=list(matrix(c(0.2134011, -0.0382573, -0.0382573, 0.2660086), ncol=2)),
df=c(7.784106)
)
mvstpdf(x = matrix(c(3.399890,-5.936962), ncol=1), xi=c(0.2528859,-2.4234067),
psi=c(11.20536,-12.51052),
sigma=matrix(c(0.2134011, -0.0382573, -0.0382573, 0.2660086), ncol=2),
df=c(7.784106)
)
#skew-normal limit
mmvsnpdfC(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=matrix(c(0, 0)), psi=matrix(c(1, 1),ncol=1), sigma=list(diag(2))
)
mvstpdf(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=c(0, 0), psi=c(1, 1), sigma=diag(2),
df=100000000
)
mmvstpdfC(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=matrix(c(0, 0)), psi=matrix(c(1, 1),ncol=1), sigma=list(diag(2)),
df=100000000
)
#non-skewed limit
mmvtpdfC(x=matrix(rep(1.96,2), nrow=2, ncol=1),
mean=matrix(c(0, 0)), varcovM=list(diag(2)),
df=10
)
mmvstpdfC(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=matrix(c(0, 0)), psi=matrix(c(0, 0),ncol=1), sigma=list(diag(2)),
df=10
)
if(require(microbenchmark)){
library(microbenchmark)
microbenchmark(mvstpdf(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=c(0, 0), psi=c(1, 1),
sigma=diag(2), df=10),
mmvstpdfC(x=matrix(rep(1.96,2), nrow=2, ncol=1),
xi=matrix(c(0, 0)), psi=matrix(c(1, 1),ncol=1),
sigma=list(diag(2)), df=10),
times=1000L)
}else{
cat("package 'microbenchmark' not available\n")
}
|
Loading required package: Rcpp
Loading required package: truncnorm
[,1]
[1,] -3.207832
[,1]
[1,] -3.207832
[,1]
[1,] -2.986451
[,1]
[1,] -2.986451
[,1]
[1,] -2.986451
[,1]
[1,] -5.258057
[,1]
[1,] -5.258057
Loading required package: microbenchmark
Unit: microseconds
expr
mvstpdf(x = matrix(rep(1.96, 2), nrow = 2, ncol = 1), xi = c(0, 0), psi = c(1, 1), sigma = diag(2), df = 10)
mmvstpdfC(x = matrix(rep(1.96, 2), nrow = 2, ncol = 1), xi = matrix(c(0, 0)), psi = matrix(c(1, 1), ncol = 1), sigma = list(diag(2)), df = 10)
min lq mean median uq max neval cld
217.127 243.264 266.47118 256.687 274.6255 3861.909 1000 b
17.184 21.642 32.82432 31.933 35.5970 1473.457 1000 a
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.