Files
GraphonSimulation/scripts/plot_sv.R

39 lines
1.0 KiB
R

# 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)
)