From 37b1a68d0c8254aebe563acce57d2a0dadbd4ae7 Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Sat, 24 May 2025 19:46:58 +0200 Subject: [PATCH] Finalize knot-placement plot --- 25_07_phd_defense/assets/make_knots_data.R | 5 ++--- 25_07_phd_defense/index.qmd | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/25_07_phd_defense/assets/make_knots_data.R b/25_07_phd_defense/assets/make_knots_data.R index 86c8031..3512c71 100644 --- a/25_07_phd_defense/assets/make_knots_data.R +++ b/25_07_phd_defense/assets/make_knots_data.R @@ -8,7 +8,7 @@ library(readr) # Creating faceted plots for different knot values and mu values # Create a function to generate the data for a given number of knots and mu value generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tailw_value, deg_value) { - grid <- seq(from = 0.01, to = 0.99, length.out = 50) + grid <- seq(from = 0, to = 1, length.out = 26) # Use provided degree B <- profoc:::make_basis_matrix(grid, profoc::make_knots( @@ -21,7 +21,7 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail ), deg = deg_value ) - B_mat <- round(as.matrix(B), 3) + B_mat <- round(as.matrix(B), 5) df <- as.data.frame(B_mat) df$x <- grid df_long <- pivot_longer(df, @@ -49,7 +49,6 @@ all_data <- list() counter <- 1 # Nested loops to cover all parameter combinations -print(paste("Processing knots:", k)) for (m in mu_values) { print(paste("Processing mu:", m)) for (s in sig_values) { diff --git a/25_07_phd_defense/index.qmd b/25_07_phd_defense/index.qmd index f2e57b5..852eb0d 100644 --- a/25_07_phd_defense/index.qmd +++ b/25_07_phd_defense/index.qmd @@ -2320,7 +2320,7 @@ chart = { const line = d3.line() .x(d => x(d.x)) .y(d => y(d.y)) - .curve(d3.curveLinear); + .curve(d3.curveBasis); // Group to contain the basis function lines const linesGroup = g.append("g")