Simplify data basis

This commit is contained in:
2025-05-18 01:58:20 +02:00
parent f768f88730
commit f9f04f22b4

5
test.R
View File

@@ -8,7 +8,8 @@ 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) {
B <- profoc:::make_basis_matrix(1:99 / 100,
grid <- seq(0, 1, length.out = 20)
B <- profoc:::make_basis_matrix(grid,
profoc::make_knots(
n = num_knots,
mu = mu_value,
@@ -19,7 +20,7 @@ generate_basis_data <- function(num_knots, mu_value) {
deg = 3
)
df <- as.data.frame(as.matrix(B))
df$x <- 1:99 / 100
df$x <- grid
df_long <- pivot_longer(df,
cols = -x,
names_to = "b",