This repository contains a complete analysis of MEG brain response data from a simulated neuromarketing experiment. The project combines nonlinear regression modelling and Bayesian inference techniques to investigate how the brain reacts to emotional versus neutral audio stimuli.
File/Folder | Description |
---|---|
SMDS_CW.R |
Main R script with structured code for data processing, modeling, and ABC |
data/ |
Contains raw input files: X.csv , y.csv , and time.csv |
Understand the structure and patterns in MEG responses under emotional and neutral audio stimuli.
- Time series of MEG and audio signals
- Histograms, boxplots, and scatter plots by stimulus type
- Pearson correlation analysis
Insight: Emotional narration resulted in higher and more varied MEG responses, justifying a nonlinear modelling approach.
- Five polynomial regression models of varying complexity
- Estimated using least squares
- Evaluated using RSS, Log-Likelihood, AIC, BIC, and residual diagnostics
Polynomial terms: x1, x1², x1⁴, x2
Demonstrated best balance between fit and generalization.
Model | RSS | AIC | BIC | Residual Normality |
---|---|---|---|---|
Model 3 | ✅ Lowest | ✅ Best | ✅ Best | ✅ Good fit |
Model 4 | Close | Slightly worse | Acceptable | Also valid |
Others | ❌ Poor fit | ❌ Higher error | ❌ Deviations | ❌ Skewed residuals |
Conclusion: Model 3 best captures the nonlinear brain response to audio stimuli.
Estimate uncertainty in the top two most influential model parameters of Model 3.
- Rejection sampling ABC
- Uniform priors (±30%) around least squares estimates
- 10,000 simulations; top 1% used to form posterior
- Marginal and joint posterior distributions
- Parameters show weak correlation, but strong identifiability
- Posterior centers align closely with initial estimates
Insight: ABC confirmed robustness of Model 3 and provided interpretable uncertainty quantification.
- Emotional voice triggers stronger brain activity measurable by MEG.
- Nonlinear regression (Model 3) provides best fit for input-output relationship.
- ABC is a powerful tool to quantify uncertainty in complex models without explicit likelihoods.
Itorobong Akpan
MSc Data Science & Computational Intelligence
Coventry University, UK
📧 [email protected]
🔗 GitHub Profile