# Setup
Sigma1 <- matrix(c(1, 0.3, 0.3, 1), 2, 2)
Sigma2 <- matrix(c(1.5, 0.5, 0.5, 1.2), 2, 2)
result <- mm_tdiff_multivariate_general(
mu1 = c(0, 1), Sigma1 = Sigma1, nu1 = 10,
mu2 = c(0, 0), Sigma2 = Sigma2, nu2 = 15
)
# Density at a point
dmvtdiff(c(0, 1), result)
# Density at multiple points
x_mat <- matrix(c(0, 1, -1, 0.5), nrow = 2, byrow = TRUE)
dmvtdiff(x_mat, result)
# Cumulative probability
pmvtdiff(c(0, 1), result)
# Random samples
samples <- rmvtdiff(100, result)
head(samples)
Run the code above in your browser using DataLab