Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SRMCappr_epsilon/SRMCappr_epsilon.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mix_cdf = function(x, index, epsilon, scale) {
if (index == "Normal") {
mix_cdf = (1 - epsilon) * pnorm(x) + epsilon * pnorm(x/scale)
} else if (index == "Laplace") {
mix_cdf = (1 - epsilon) * pnorm(x) + epsilon * plaplacex/scale)
mix_cdf = (1 - epsilon) * pnorm(x) + epsilon * plaplace(x/scale)
} else {
mix_cdf = (1 - epsilon) * pnorm(x) + epsilon * ppower(x/scale)
}
Expand Down Expand Up @@ -108,6 +108,8 @@ mix_ES_epsilon = function(epsilon, index, alpha, scale) {
# Give the theoretical values and its approximations of VaR, ES and level ratio for epsilon-contamination model at alpha level
approximation.VaR.ES.epsilon = function(epsilon, index, scale, alpha) {
Theoretical_VaR.ES.EQT = matrix(rep(1, size.epsilon * size.index * 3), nrow = size.epsilon)
size.epsilon = length(epsilon)
size.index = length(index)
Approximation_VaR.ES.EQT = matrix(rep(1, size.epsilon * size.index * 3), nrow = size.epsilon)
colnames(Theoretical_VaR.ES.EQT) = paste(c(rep("VaR of", size.index), rep("ES of",
size.index), rep("Level ratio of", size.index)), rep(index, 3))
Expand Down