June 07, 2026

## Voxel Activation Dataset {.bigger}

# Inspecting our simulated neuroimaging dataset
head(neuro_data)
  Stimulus Attention     BOLD
1 92.33254  7.474407 50.22416
2 94.33679  3.916774 38.57873
3 35.75256  8.009285 33.38642
4 84.74029  4.549969 40.99148
5 67.75710  7.107336 38.02466
6 56.71864  7.982425 32.10281

Slide 2: Neuroimaging Context

  • Functional fMRI maps localized hemodynamic blood-flow fluctuations.
  • The primary dependent metric of interest is the BOLD signal profile.
  • Metabolic energy demands shift directly during active sensory stimulation.
  • We model BOLD response variations programmatically using linear arrays.
  • Core model predictors include absolute visual stimulus and user attention.

Slide 3: The Neural Mathematical Model

  • This slide utilizes standard \(\LaTeX\) mathematical syntax array notations:

\[Y_i = \beta_0 + \beta_1 X_{1i} + \beta_2 X_{2i} + \epsilon_i\]

  • \(Y_i\) corresponds directly to the target fMRI BOLD response values.
  • \(X_{1i}\) tracks the percentage stimulus intensity contrast parameters.
  • \(X_{2i}\) maps the specific measured behavioral participant attention metrics.
  • \(\epsilon_i\) effectively accounts for stochastic background scanner noise elements.

Slide 4: Optimization & Structural Assumptions

  • Parameter optimization calculations leverage standard matrix algebraic equations:

    \[\min \sum_{i=1}^{n} \epsilon_i^2 = \min \sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2\]

    • Neural noise residuals \(\epsilon\) assume a perfectly normal distribution variance.
  • High scanner baseline signal drift parameters must be tightly controlled.

Slide 5: Hemodynamic Exploration (ggplot 1)

ggplot(neuro_data, aes(x = Stimulus, y = BOLD)) +
  geom_point(color = "#8C1D40", alpha = 0.7, size = 3) +
  geom_smooth(method = "lm", color = "black") +
  theme_minimal() +
  labs(x = "Stimulus Intensity (% Contrast)", y = "BOLD Signal Change (%)")
`geom_smooth()` using formula = 'y ~ x'

Slide 6: Signal Distribution Profile (ggplot 2)

ggplot(neuro_data, aes(x = BOLD)) +
  geom_histogram(bins = 15, fill = "#8C1D40", color = "white") +
  theme_minimal() +
  labs(x = "BOLD Signal Change (%)", y = "Voxel Count")

Slide 7: 3D Activation Surface Map (plotly)

Hemodynamic 3D Linear Modeling Surface map:

# 1. Fit the linear regression model
fit <- lm(BOLD ~ Stimulus + Attention, data = neuro_data)

# 2. Extract sequence grids using bracket syntax
axis_x <- seq(min(neuro_data[["Stimulus"]]), max(neuro_data[["Stimulus"]]), length.out = 20)
axis_y <- seq(min(neuro_data[["Attention"]]), max(neuro_data[["Attention"]]), length.out = 20)

# 3. Create the mathematical surface matrix
surface_matrix <- t(outer(axis_x, axis_y, function(x, y) {
  predict(fit, newdata = data.frame(Stimulus = x, Attention = y))
}))

# 4. Build and print the interactive plot directly
plot_ly(neuro_data, x = ~Stimulus, y = ~Attention, z = ~BOLD, height = 350, width = 800) %>%
  add_markers(marker = list(color = '#8C1D40', size = 4, opacity = 0.6)) %>%
  add_surface(x = ~axis_x, y = ~axis_y, z = ~surface_matrix, opacity = 0.5)

Slide 8: Neuroscientific Conclusions

  • Sensory input scales directly alongside measured BOLD variations.
  • Attentional focus parameters alter baseline neural response curves.
  • Multi-predictor regressions chart complex interactive localized spaces.
  • Modern R modeling engines unlock automated reproducible brain workflows.