Update app.qmd

This commit is contained in:
2025-05-23 23:17:00 +02:00
parent 5639c11809
commit b6f7263b12
2 changed files with 9 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ d3 = require("d3@7")
``` ```
```{ojs} ```{ojs}
bsplineData = FileAttachment("basis_functions.csv").csv({ typed: true }) bsplineData = FileAttachment("assets/mcrps_learning/basis_functions.csv").csv({ typed: true })
``` ```
```{ojs} ```{ojs}

View File

@@ -21,9 +21,9 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail
), ),
deg = deg_value deg = deg_value
) )
B_mat <- round(as.matrix(B),2) B_mat <- round(as.matrix(B), 2)
df <- as.data.frame(B_mat) df <- as.data.frame(B_mat)
df$x <- round(grid,2) df$x <- round(grid, 2)
df_long <- pivot_longer(df, df_long <- pivot_longer(df,
cols = -x, cols = -x,
names_to = "b", names_to = "b",
@@ -42,7 +42,7 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail
knot_values <- c(10) knot_values <- c(10)
mu_values <- seq(0.1, 0.9, by = 0.2) mu_values <- seq(0.1, 0.9, by = 0.2)
sig_values <- 2^(-2:2) sig_values <- 2^(-2:2)
nonc_values <- c(-4,-2,0,2,4) nonc_values <- c(-4, -2, 0, 2, 4)
tailw_values <- 2^(-2:2) tailw_values <- 2^(-2:2)
# Create an empty list to store all combinations # Create an empty list to store all combinations
@@ -68,4 +68,6 @@ for (k in knot_values) {
# Combine all data frames # Combine all data frames
all_data <- bind_rows(all_data) all_data <- bind_rows(all_data)
write_csv(all_data, "basis_functions.csv") write_csv(all_data, "25_07_phd_defense/assets/mcrps_learning/basis_functions.csv")
# %%