Skip to content

hickel0/complex-computational-models

Repository files navigation

Complex Computational Models

Python ABM Time Series Status

Comprehensive coursework covering agent-based modeling, cellular automata simulations, and time series analysis with practical implementations in Python and Excel.

πŸ“‹ Project Overview

This repository contains projects and coursework from Complex Computational Models (CSC1111/CSC1139), focusing on simulation techniques, time series forecasting, and computational modeling of complex systems.

Course Codes: CSC1111, CSC1139 Topics: Cellular Automata, Agent-Based Models, Time Series Analysis Status: βœ… Completed with Multiple Projects

🎯 Learning Objectives

  • Understand and implement cellular automata and agent-based models
  • Master time series analysis and forecasting techniques
  • Apply computational modeling to real-world phenomena
  • Develop simulation skills for complex adaptive systems
  • Analyze and visualize emergent behaviors

πŸ“‚ Repository Structure

Complex Comp Models/
β”œβ”€β”€ Cellular Automata/
β”‚   β”œβ”€β”€ Lab01.ipynb                          # Introduction to cellular automata
β”‚   β”œβ”€β”€ agent_based_model.py                 # General ABM framework
β”‚   β”œβ”€β”€ predator_prey_simulation.py          # Predator-prey dynamics
β”‚   β”œβ”€β”€ segregation_model.py                 # Schelling's segregation model
β”‚   β”œβ”€β”€ dla_simulation.py                    # Diffusion-limited aggregation
β”‚   β”œβ”€β”€ network_visualization.py             # Network analysis and viz
β”‚   └── assignment/
β”‚       β”œβ”€β”€ virus_spread_simulation.py       # COVID-19 spread simulation
β”‚       β”œβ”€β”€ report_generator.py              # Automated report creation
β”‚       └── README.md                        # Assignment documentation
β”‚
β”œβ”€β”€ Time Series/
β”‚   β”œβ”€β”€ W1/ - W6/                            # Weekly materials
β”‚   β”œβ”€β”€ TSClassExercise_answers.xlsx         # Time series class exercises
β”‚   β”œβ”€β”€ MA_Forecast_model_answers.xlsx       # Moving Average models
β”‚   β”œβ”€β”€ School_leavers_additive_model.xlsx   # Additive decomposition
β”‚   β”œβ”€β”€ JandJ_time_series_solutions.xlsx     # Johnson & Johnson analysis
β”‚   └── VIX_daily_analysis.xlsx              # Volatility index analysis
β”‚
β”œβ”€β”€ Past Exams/
β”‚   └── [Exam papers and solutions]
β”‚
β”œβ”€β”€ Lean_Business_Model_Canvas_GreenGrid_AI.pdf
β”œβ”€β”€ Cheat_Sheet.pdf
└── revision_notes.md

πŸ”¬ Key Projects

1. Cellular Automata & Agent-Based Models

Virus Spread Simulation (Featured Assignment)

A sophisticated agent-based model simulating disease spread through a population.

Features:

  • Configurable infection parameters (transmission rate, recovery time, mortality)
  • Spatial movement and contact tracing
  • Intervention strategies (lockdowns, social distancing, vaccination)
  • Real-time visualization of spread dynamics
  • Statistical analysis of outbreak patterns

Skills: Agent-based modeling, simulation, Python OOP, data visualization

Files: Cellular Automata/assignment/virus_spread_simulation.py

Predator-Prey Dynamics

Implementation of Lotka-Volterra equations and agent-based predator-prey models.

Features:

  • Population dynamics simulation
  • Emergent cyclical patterns
  • Parameter sensitivity analysis
  • Visualization of population trajectories

Files: Cellular Automata/predator_prey_simulation.py

Schelling's Segregation Model

Simulation demonstrating how individual preferences can lead to large-scale segregation.

Features:

  • Agent preferences and movement rules
  • Emergent segregation patterns
  • Threshold analysis
  • Spatial visualization

Files: Cellular Automata/segregation_model.py

Diffusion-Limited Aggregation (DLA)

Fractal growth simulation modeling particle aggregation.

Features:

  • Random walk particle dynamics
  • Fractal pattern formation
  • Visualization of growth structures
  • Dimension analysis

Files: Cellular Automata/dla_simulation.py

Network Visualization

Complex network analysis and visualization tools.

Features:

  • Graph generation and analysis
  • Network metrics (centrality, clustering)
  • Community detection
  • Interactive visualizations

Files: Cellular Automata/network_visualization.py

2. Time Series Analysis & Forecasting

Time Series Class Exercises

Comprehensive exercises covering fundamental time series concepts.

Topics Covered:

  • Trend identification and removal
  • Seasonal decomposition
  • Stationarity testing
  • Autocorrelation analysis

Files: Time Series/TSClassExercise_answers.xlsx

Moving Average Forecasting Models

Implementation and comparison of MA forecasting techniques.

Models:

  • Simple Moving Average (SMA)
  • Weighted Moving Average (WMA)
  • Exponential Smoothing
  • Model performance comparison

Files: Time Series/MA_Forecast_model_answers.xlsx

School Leavers Additive Model

Seasonal decomposition using additive model.

Analysis:

  • Trend-cycle component extraction
  • Seasonal pattern identification
  • Irregular component analysis
  • Forecasting with seasonal adjustment

Files: Time Series/School_leavers_additive_model.xlsx

Johnson & Johnson Time Series

Real-world financial time series analysis.

Techniques:

  • Multiplicative decomposition
  • Exponential growth trends
  • Seasonal indices calculation
  • Business forecasting

Files: Time Series/JandJ_time_series_solutions.xlsx

VIX Daily Analysis

Volatility Index (VIX) time series analysis.

Focus:

  • Financial volatility modeling
  • ARCH/GARCH concepts
  • Market risk analysis
  • Volatility forecasting

Files: Time Series/VIX_daily_analysis.xlsx

πŸ› οΈ Technologies Used

Python Stack

numpy==1.24.0           # Numerical computing
matplotlib==3.7.0       # Visualization
scipy==1.10.0           # Scientific computing
networkx==3.0           # Network analysis
pandas==2.0.0           # Time series data manipulation

Simulation Libraries

  • Custom agent-based modeling framework
  • Cellular automata implementations
  • Random walk simulations

Analysis Tools

  • Microsoft Excel (time series analysis)
  • Jupyter Notebook (interactive development)
  • Python statistical libraries

πŸ“Š Key Concepts Covered

Cellular Automata

  • Conway's Game of Life
  • Elementary cellular automata (Rule 30, Rule 110)
  • 2D grid-based simulations
  • Emergence and self-organization
  • Computational universality

Agent-Based Modeling

  • Individual agent behaviors
  • Interaction rules
  • Emergent collective phenomena
  • Spatial dynamics
  • Parameter sensitivity
  • Model validation

Time Series Analysis

  • Components: Trend, Seasonal, Cyclical, Irregular
  • Decomposition methods (additive/multiplicative)
  • Smoothing techniques
  • Forecasting methods:
    • Moving Averages
    • Exponential Smoothing
    • Holt-Winters
    • ARIMA concepts
  • Model evaluation (MAE, RMSE, MAPE)

Complex Systems

  • Nonlinearity and feedback loops
  • Self-organization
  • Emergence
  • Power laws and scale-free networks
  • Tipping points and phase transitions

🎯 Assignment: Virus Spread Simulation

Objectives

Develop an agent-based model to simulate disease spread and evaluate intervention strategies.

Model Parameters

  • Population size: Configurable
  • Infection rate: Beta parameter
  • Recovery time: Average days to recovery
  • Mortality rate: Percentage of infected who die
  • Movement: Random walk or directed
  • Interventions: Lockdown, social distancing, vaccination

Deliverables

  • βœ… Python simulation code
  • βœ… Visualization of spread dynamics
  • βœ… Statistical analysis
  • βœ… Report on intervention effectiveness
  • βœ… Automated report generation

Results

  • Successfully modeled disease spread dynamics
  • Demonstrated effectiveness of early interventions
  • Analyzed parameter sensitivity
  • Generated reproducible results

Documentation: See Cellular Automata/assignment/README.md

πŸ“ˆ Time Series Projects Summary

Project 1: School Leavers Forecasting

Objective: Forecast number of school leavers using seasonal decomposition Method: Additive model Result: Accurate seasonal forecasts with trend analysis

Project 2: Johnson & Johnson Stock Analysis

Objective: Analyze quarterly earnings and forecast future performance Method: Multiplicative decomposition with exponential trend Result: Successfully captured growth trend and seasonal patterns

Project 3: VIX Volatility Analysis

Objective: Model and forecast market volatility Method: Advanced time series techniques Result: Insights into market risk patterns

Project 4: Moving Average Comparison

Objective: Compare forecasting performance of different MA methods Method: SMA, WMA, Exponential Smoothing Result: Exponential smoothing performed best for trending data

πŸ”§ Setup & Installation

Prerequisites

Python 3.8 or higher
Microsoft Excel (for time series exercises)
Jupyter Notebook (optional)

Installation

  1. Navigate to project directory
cd "D:\Final Year\Complex Comp Models"
  1. Install Python dependencies
pip install numpy matplotlib scipy pandas networkx
pip install jupyter notebook  # Optional
  1. Run simulations
# Virus spread simulation
python "Cellular Automata/assignment/virus_spread_simulation.py"

# Predator-prey model
python "Cellular Automata/predator_prey_simulation.py"

# Segregation model
python "Cellular Automata/segregation_model.py"
  1. Open time series exercises
  • Open Excel files in Time Series/ folder
  • Follow worksheet instructions
  • Review solutions and methodologies

πŸ“š Learning Resources

Textbooks & References

  • Wolfram: "A New Kind of Science"
  • Railsback & Grimm: "Agent-Based and Individual-Based Modeling"
  • Box & Jenkins: "Time Series Analysis: Forecasting and Control"
  • Hyndman & Athanasopoulos: "Forecasting: Principles and Practice"

Course Materials

  • Weekly lecture notes (W1-W6)
  • Past exam papers with solutions
  • Cheat sheet for quick reference
  • Revision notes

πŸŽ“ Skills Demonstrated

Computational Modeling

  • Agent-Based Modeling
  • Cellular Automata
  • Discrete Event Simulation
  • Monte Carlo Methods
  • Stochastic Processes

Time Series Analysis

  • Decomposition Techniques
  • Forecasting Methods
  • Trend Analysis
  • Seasonal Adjustment
  • Model Selection and Evaluation

Programming & Visualization

  • Python OOP Design
  • NumPy and SciPy
  • Matplotlib Visualization
  • Network Analysis (NetworkX)
  • Excel Data Analysis

Analytical Thinking

  • Complex Systems Understanding
  • Emergence Recognition
  • Parameter Sensitivity Analysis
  • Model Validation
  • Critical Evaluation

πŸš€ Advanced Topics

Explored Concepts

  • Power law distributions
  • Scale-free networks
  • Self-organized criticality
  • Chaos theory basics
  • Adaptive complex systems

Future Extensions

  • Machine learning integration with ABM
  • Real-time simulation visualization
  • GPU-accelerated simulations
  • Deep learning for time series (LSTM)
  • Multi-agent reinforcement learning

πŸ“ Business Application

GreenGrid AI Lean Canvas

Application of complex models to sustainability startup:

  • Problem: Energy grid inefficiency
  • Solution: Agent-based modeling for smart grid optimization
  • Key Metrics: Energy savings, grid stability
  • Competitive Advantage: Predictive modeling using complex systems

File: Lean_Business_Model_Canvas_GreenGrid_AI.pdf

🎯 Assessment & Performance

Assignments

  • Virus Spread Simulation: [Grade]
  • Time Series Forecasting: [Grade]
  • Cellular Automata Implementation: [Grade]

Exams

  • Midterm: [Score]
  • Final: [Score]

Overall Performance

Demonstrated strong understanding of:

  • Simulation methodology
  • Time series techniques
  • Complex systems theory
  • Python implementation
  • Analytical problem-solving

πŸ“„ License

Academic coursework - All rights reserved

πŸ™ Acknowledgments

  • Course instructors for comprehensive teaching
  • Open-source simulation communities
  • Research papers on complex systems
  • Textbook authors

Course: CSC1111/CSC1139 - Complex Computational Models Academic Year: 2025-2026 Topics: Agent-Based Modeling, Cellular Automata, Time Series Last Updated: June 2026

About

Agent-based modeling, cellular automata simulations, and time series forecasting projects.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages