Update app.qmd
This commit is contained in:
@@ -15,7 +15,7 @@ d3 = require("d3@7")
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
bsplineData = FileAttachment("basis_functions.csv").csv({ typed: true })
|
||||
bsplineData = FileAttachment("assets/mcrps_learning/basis_functions.csv").csv({ typed: true })
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
@@ -21,9 +21,9 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail
|
||||
),
|
||||
deg = deg_value
|
||||
)
|
||||
B_mat <- round(as.matrix(B),2)
|
||||
B_mat <- round(as.matrix(B), 2)
|
||||
df <- as.data.frame(B_mat)
|
||||
df$x <- round(grid,2)
|
||||
df$x <- round(grid, 2)
|
||||
df_long <- pivot_longer(df,
|
||||
cols = -x,
|
||||
names_to = "b",
|
||||
@@ -42,7 +42,7 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail
|
||||
knot_values <- c(10)
|
||||
mu_values <- seq(0.1, 0.9, by = 0.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)
|
||||
|
||||
# Create an empty list to store all combinations
|
||||
@@ -57,8 +57,8 @@ for (k in knot_values) {
|
||||
for (s in sig_values) {
|
||||
for (nc in nonc_values) {
|
||||
for (tw in tailw_values) {
|
||||
all_data[[counter]] <- generate_basis_data(5, m, s, nc, tw, 2)
|
||||
counter <- counter + 1
|
||||
all_data[[counter]] <- generate_basis_data(5, m, s, nc, tw, 2)
|
||||
counter <- counter + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,4 +68,6 @@ for (k in knot_values) {
|
||||
# Combine all data frames
|
||||
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")
|
||||
|
||||
# %%
|
||||
Reference in New Issue
Block a user