View source: R/Copula_errors.R
| Copula_errors | R Documentation |
This function calculates the Mean Squared Error (MSE) and relative error for Copula distributions.
Copula_errors(data, copula_type, param)
data |
Matrix of data. |
copula_type |
Character string specifying the type of Copula (e.g., "clayton", "gumbel", "frank", "t", "nested", "mixed", "galambos", "normal"). |
param |
Parameters for the specified Copula type. |
A named vector containing:
MSE |
Mean Squared Error for the Copula distribution. |
RelativeError |
Relative error for the Copula distribution. |
# Example for Clayton Copula
if (!requireNamespace("copula", quietly = TRUE)) {
utils::install.packages("copula")
}
library(copula)
set.seed(123)
n <- 1000
clayton.cop <- copula::claytonCopula(2, dim = 2)
data <- copula::rCopula(n, clayton.cop)
errors <- Copula_errors(data, "clayton", 2)
print(errors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.