diff --git a/scripts/plot_sv.R b/scripts/plot_sv.R new file mode 100644 index 0000000..741ae8f --- /dev/null +++ b/scripts/plot_sv.R @@ -0,0 +1,39 @@ +# Load function ---------------------------------------------------------------- +source(here::here("R", "singular_values.R")) +source(here::here("R", "graphon_distribution.R")) +source(here::here("R", "singular_value_plot.R")) + +# Nearly match with sample function -------------------------------------------- +# v ~ N(0,1) and X ~ discrete Uniform on [1:n] +smallest_sv_sequence( + a = c(0.5), + n = 400, + maxK= 20, + sampler_fn = sample, + guard=1e-12, + plot=TRUE, + curve_expr = quote(20 / sqrt(x)) +) + +# Normally distributed X ~ N(0,1) and v ~ N(0,1) ------------------------------- +smallest_sv_sequence( + a = c(0.5), + n = 400, + maxK = 20, + sampler_fn =function(n) matrix(rnorm(n), ncol = 1L), + guard=1e-12, + plot=TRUE, + log_plot = TRUE, + curve_expr = quote(20 / exp(x^1.32)) +) + +# Uniform distributed X ~ U[0,1] and v ~ N(0,1) -------------------------------- +smallest_sv_sequence( + a = c(0.5), + n = 400, + maxK = 20, + sampler_fn =function(n) matrix(runif(n), ncol = 1L), + guard=1e-12, + plot=TRUE, + curve_expr = quote(20 / x^2) +) \ No newline at end of file