mirror of
https://github.com/Zenithsiz/ist-pe-proj.git
synced 2026-02-03 05:57:12 +00:00
Fixed 8.
This commit is contained in:
parent
9c27df5b32
commit
83124e719f
@ -15,13 +15,13 @@ cauchy_gen <- sort(cauchy_gen)
|
||||
quantile_idxs <- 1:107 / (107 + 1)
|
||||
|
||||
cauchy_quantiles <- sapply(quantile_idxs, function(p) {
|
||||
cauchy_location + cauchy_scale * tan(pi * (p - 0.5))
|
||||
qcauchy(p, location = cauchy_location, scale = cauchy_scale)
|
||||
})
|
||||
|
||||
norm_mean <- -2.8
|
||||
norm_var <- 1.4
|
||||
norm_quantiles <- sapply(quantile_idxs, function(p) {
|
||||
norm_mean + sqrt(2 * norm_var) * erfinv(2 * p - 1)
|
||||
qnorm(p, mean = norm_mean, sd = sqrt(norm_var))
|
||||
})
|
||||
|
||||
df <- data.frame(
|
||||
@ -36,9 +36,10 @@ plot <- ggplot(df, aes(x = quantile_idxs)) +
|
||||
geom_line(aes(y = cauchy_gen, color = "Generated")) +
|
||||
geom_line(aes(y = cauchy_quantiles, color = "Cauchy Quantiles")) +
|
||||
geom_line(aes(y = norm_quantiles, color = "Normal Quantiles")) +
|
||||
geom_line(aes(y = quantile_idxs, color = "Line bisector of odd quadrants")) +
|
||||
xlab("Quantiles") +
|
||||
ylab("") +
|
||||
scale_color_manual(values = c("red", "blue", "green")) +
|
||||
scale_color_manual(values = c("red", "blue", "black", "green")) +
|
||||
theme(legend.title = element_blank())
|
||||
|
||||
ggsave(plot = plot, "output.png")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user