Skip to content

Commit

Permalink
Conver to webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
j1c committed Apr 26, 2023
1 parent a9d020e commit 68a6d55
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: deploy

on:
# Trigger the workflow on push to main branch
push:
branches:
- main

# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r ./requirements.txt
# Build the book
- name: Build the book
run: |
jupyter-book build .
# # Move html and pdfs
# - name: Moving slides
# run: |
# for FILE in $(cat ./docs/slides/manifest.txt)
# do
# \cp -fR "./docs/slides/${FILE}/" ./docs/_build/html/
# done

# # Moving images
# - name: Moving images
# run: |
# \cp -fR ./docs/slides/images/ ./docs/_build/html/

# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# mgcx_experiments
# Independence Testing for Multivariate Time Series

Complex data structures such as time series are increasingly more prevalent in modern data science problems. A fundamental question is whether two such time-series have a statistically significant relationship. Many current approaches rely on making parametric assumptions on the random processes, detecting only linear associations, requiring multiple tests, or sacrificing power in high-dimensional and nonlinear settings. The distribution of any test statistic under the null hypothesis is challenging to estimate, as the permutation test is typically invalid. This study combines distance correlation (Dcorr) and multiscale graph correlation (MGC) from independence testing literature with block permutation from time series analysis to address these challenges. The proposed nonparametric procedure is asymptotic valid, consistent for dependence testing under stationary time-series, able to estimate the optimal lag that maximizes the dependence. It eliminates the need for multiple testing, and exhibits superior power in high-dimensional, low sample size, and nonlinear settings. The analysis of neural connectivity with fMRI data reveals a linear dependence of signals within the visual network and default mode network and nonlinear relationships in other networks. This work provides a primary data analysis tool with open-source code, impacting a wide range of scientific disciplines.
58 changes: 58 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Independence Testing in Time-series Data # The title of the book. Will be placed in the left navbar.
author: Jaewon Chung, Ronak Mehta # The author of the book
copyright: "2023" # Copyright year to be placed in the footer
logo: ./images/nd_logo.png # A path to the book logo
exclude_patterns: [_build, Thumbs.db, .DS_Store, "**.ipynb_checkpoints"]
# Auto-exclude files not in the toc
only_build_toc_files: true

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: off

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: mgcx.tex
theme: howto

sphinx:
config: # key-value pairs to directly over-ride the Sphinx configuration
language: en
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
# html_extra_path: ["docs"]
mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# Information about where the book exists on the web
repository:
url: https://github.com/neurodata/mgcx
path_to_book: mgcx
branch: main

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
favicon: ./images/mage.png
comments:
hypothesis: false
use_repository_button: true
use_issues_button: true
use_edit_page_button: false
home_page_in_navbar: true

parse:
myst_enable_extensions: #https://myst-parser.readthedocs.io/en/latest/sphinx/reference.html#sphinx-config-options
- linkify # automatically identify “bare” web URLs and add hyperlinks
- dollarmath
- amsmath
myst_nb_output_stderr:
- "remove"
6 changes: 6 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
format: jb-book
root: README
parts:
- caption: Figures
chapters:
- url: figure1
69 changes: 69 additions & 0 deletions figure1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "3522aa07-8839-4272-93b5-c8ed76e934e1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Obtaining file:///Users/j1c/git/mgcx/hyppo\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: numpy>=1.17 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from hyppo==0.3.2) (1.23.5)\n",
"Requirement already satisfied: scipy>=1.4.0 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from hyppo==0.3.2) (1.10.1)\n",
"Requirement already satisfied: numba>=0.46 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from hyppo==0.3.2) (0.56.4)\n",
"Requirement already satisfied: scikit-learn>=0.19.1 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from hyppo==0.3.2) (1.2.2)\n",
"Requirement already satisfied: autograd>=1.3 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from hyppo==0.3.2) (1.5)\n",
"Requirement already satisfied: future>=0.15.2 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from autograd>=1.3->hyppo==0.3.2) (0.18.3)\n",
"Requirement already satisfied: llvmlite<0.40,>=0.39.0dev0 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from numba>=0.46->hyppo==0.3.2) (0.39.1)\n",
"Requirement already satisfied: setuptools in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from numba>=0.46->hyppo==0.3.2) (66.0.0)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from scikit-learn>=0.19.1->hyppo==0.3.2) (2.2.0)\n",
"Requirement already satisfied: joblib>=1.1.1 in /Users/j1c/miniconda3/envs/mgcx/lib/python3.9/site-packages (from scikit-learn>=0.19.1->hyppo==0.3.2) (1.1.1)\n",
"Installing collected packages: hyppo\n",
" Attempting uninstall: hyppo\n",
" Found existing installation: hyppo 0.3.2\n",
" Uninstalling hyppo-0.3.2:\n",
" Successfully uninstalled hyppo-0.3.2\n",
" Running setup.py develop for hyppo\n",
"Successfully installed hyppo-0.3.2\n"
]
}
],
"source": [
"!pip install -e ./hyppo"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3b289764-53f8-4385-b763-1f7880070cbe",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file added images/mage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nd_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nd_logo_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jupyter-book
matplotlib
numpy
ghp-import

0 comments on commit 68a6d55

Please sign in to comment.