Characterizing developmental changes in infant habituation using functional change point detection.
The 8 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Methods › Further Analysis of Statistically Significant Change Points › Analyzing the effect of age ↔ statsScripts/statGroupChangePoints.ipynb, lines 498–581 · score 0.75 · Weighted ordinal logistic, OrderedModel, post hoc, logit, predictors, fit
- [2] § Methods › Data Processing ↔ scripts/generateSimulatedHabituationData.ipynb, lines 123–237 · score 0.65 · low pass filter, stimulus onset, cutoff, oscillations, linearly, channel
- [3] § Methods › Detecting Changes in the Evoked Hemodynamic Response ↔ plotting/plotSimulatedCUSUM.ipynb, the whole file · a weak match · score 0.62 · CUSUM statistics, Brownian Bridges, anchored, simulated, absolute, deviations
- [4] § Appendix B: FCPt significance testing with Brownian Bridges ↔ functions/funcChangePoint.py, lines 29–119 · score 0.62 · wild binary segmentation, Brownian Bridge, interval, recursive, component, sum
- [5] § Methods › Detecting Changes in the Evoked Hemodynamic Response › Monte Carlo simulation to assess functional change point significance ↔ functions/funcChangePoint.py, lines 29–119 · score 0.60 · wild binary segmentation, Brownian Bridges, interval, summed
- [6] § Methods › Further Analysis of Statistically Significant Change Points › Analyzing the effect of age ↔ statsScripts/statIindigoIndividualChangePoints.ipynb, lines 789–867 · score 0.59 · post hoc Wald, ANOVA model, HSD, Tukey, Pairwise
- [7] § Methods › Data Processing ↔ functions/fNIRSData.py, lines 530–557 · score 0.53 · Linear detrending, stimulus onset
- [8] § Results ↔ plotting/viewGroupCPts.ipynb, lines 118–233 · score 0.51 · month participants, concentration change, ROI channel, surface, Chromophore
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 183 lines · 7.5 KB · MIT · 2 matches
- import skfda
- import numpy as np
- import pandas as pd
- from skfda.preprocessing.dim_reduction import FPCA
- from skfda.representation.basis import BSplineBasis
- import sys
- from pathlib import Path
- # Root of this project (the folder containing this notebook, or an ancestor of
- # it, named 'FDA'). Walks up from the current working directory until it finds
- # one. (Same pattern used throughout this project's notebooks.)
- cwd = Path().resolve()
- if cwd.name == 'FDA':
- projectRoot = cwd
- else:
- for parent in cwd.parents:
- if parent.name == 'FDA':
- projectRoot = parent
- break
- else:
- raise FileNotFoundError("Could not find FDA project root")
- sys.path.append(str(projectRoot / 'functions'))
- import auxFuncChPt as auxF
- ##########################################################################################################################################
- def changeFPCA(fdObj, dHat=0, numBootstrap=10000, h=0, plot=False, longRun=True, wildBinSeg=False, numIntervals=500, *args, **kwargs):
- #check fd input object is in the correct form
- if not(isinstance(fdObj, skfda.representation.basis._fdatabasis.FDataBasis)
- or isinstance(fdObj, skfda.representation.grid.FDataGrid)):
- #return error if not
- raise ValueError("Must use functional data in basis representation or grid form")
- if isinstance(fdObj, skfda.representation.basis._fdatabasis.FDataBasis):
- N = fdObj.coefficients[:, 0].shape[0] # First dimension = rows = number of functional objects
- D = fdObj.coefficients[0].shape[0] # Second dimension = columns = number of basis functions
- else:
- #if FDataGrid
- N = fdObj.data_matrix.shape[0] # First dimension = rows = number of functional objects
- #num fPCs must be less than size of dataset and of number of sample points
- D = np.min([(N-1), (fdObj.data_matrix.shape[1])]) #set to min of these two values
- #set up PCA with full number of components
- #fPCA = FPCA(n_components=D) #centering = TRUE applied as default
- #find variance for each fPC
- #fPCAScores = fPCA.fit_transform(fdObj) #requires scores/comps to first be calculated
- # calculate fPCA
- # check if specific number of PCs desired in reconstruction; find them using threshold (default 85%) if not
- if not(dHat):
- dHat = auxF.cumulPercVariance(fdObj)
- dHat = min(N, dHat)
- #set up PCA with required number of components
- fPCA = FPCA(n_components=dHat) #centering = TRUE applied as default
- #find variance for each fPC
- fPCAScores = fPCA.fit_transform(fdObj) #requires scores/comps to first be calculated
- # Auto-select h if not provided
- if longRun == True:
- if h == 0: #if lag not provided
- h = int(4 * (N / 100) ** (2 / 9)) # calculate using Newey-West rule, via. Andrews (1991)
- h = np.min([h, N-1]) #adjust lag if not enough functional data in this recursive iteration of binseg
- else:
- h = 0 #just in case non-zero lag given when not using the L-R covariance
- #calculate (long-run) covariance
- sigmaHat = auxF.calcLRCovGrid(fPCAScores, d = dHat, h = h)
- #invert it for partial sum calculation
- invSigmaHat = np.linalg.inv(sigmaHat).astype('float64')
- if wildBinSeg:
- # Wild Binary Segmentation approach
- intervals = auxF.generateRandomIntervals(N, numIntervals)
- maxT_NAll = []
- kStarAll = []
- for startIdx, endIdx in intervals:
- intervalLength = endIdx - startIdx
- T_N = np.empty(intervalLength)
- for k in range(intervalLength):
- L_Nk = auxF.computeIntervalPartialSumFPCA(k, fPCAScores, dHat, startIdx, endIdx)
- T_N[k] = (1/intervalLength) * (np.dot(np.transpose(L_Nk), (np.dot(invSigmaHat, L_Nk))))
- maxT_N = np.max(np.abs(T_N))
- kStar_interval = (np.where(np.abs(T_N) == maxT_N))[0][0]
- maxT_NAll.append((maxT_N, kStar_interval + startIdx))
- # Find interval with maximum test statistic
- maxT_N, kStar = max(maxT_NAll, key=lambda x: x[0])
- else:
- # Original approach
- T_N = np.empty(N)
- for k in range(N):
- L_Nk = auxF.computeIntervalPartialSumFPCA(k, fPCAScores, dHat)
- T_N[k] = (1/N) * (np.dot(np.transpose(L_Nk), (np.dot(invSigmaHat, L_Nk))))
- maxT_N = np.max(np.abs(T_N))
- kStar = (np.where(T_N == maxT_N))[0][0]
- # Bootstrap and significance calculation
- bridgeVals = auxF.brownianBridgeBootstrap(dHat, N, numPerms=numBootstrap)
- z = np.sum((maxT_N <= bridgeVals) == True)
- pValue = z / (bridgeVals.shape)[0]
- # Calculate means
- preChangeFuncs = (fdObj[:kStar])
- preChangeMean = skfda.exploratory.stats.mean(preChangeFuncs)
- postChangeFuncs = (fdObj[kStar:])
- postChangeMean = skfda.exploratory.stats.mean(postChangeFuncs)
- deltaMeans = preChangeMean - postChangeMean
- return kStar, pValue, maxT_N, preChangeMean, postChangeMean, deltaMeans, dHat
- ##########################################################################################################################################
- def changeFF(fdObj, numBootstrap=10000, h=0, firstSamp=-20, lastSamp=182, numComponents=15, plot=False, longRun=True, wildBinSeg=False, numBinSegIntervals=500, *args, **kwargs):
- # Original input checks and setup remain the same
- if not(isinstance(fdObj, skfda.representation.basis._fdatabasis.FDataBasis)
- or isinstance(fdObj, skfda.representation.grid.FDataGrid)):
- raise ValueError("Must use functional data in basis representation or grid form")
- if isinstance(fdObj, skfda.representation.grid.FDataGrid):
- basis = BSplineBasis(n_basis=numComponents)
- fdObj = fdObj.to_basis(basis)
- coefs = fdObj.coefficients.astype('float64')
- N = coefs[:, 0].shape[0]
- D = coefs[0].shape[0]
- if wildBinSeg:
- intervals = auxF.generateRandomIntervals(N, numBinSegIntervals)
- allMaxPartialSum = []
- kStarAll = []
- for startIdx, endIdx in intervals:
- S_N = auxF.computeIntervalPartialSumFF(coefs, startIdx, endIdx)
- maxS_N = np.max(np.abs(S_N))
- kStar = (np.where(S_N == maxS_N))[0][0]
- allMaxPartialSum.append((maxS_N, kStar + startIdx, endIdx - startIdx))
- maxS_N, kStar, segSize = max(allMaxPartialSum, key=lambda x: x[0])
- else:
- S_N = np.zeros([N])
- for i in range(2, N):
- S_N[i-1] = (np.sum((np.sum(coefs[0:i, :], axis=0) -
- (i/N) * np.sum(coefs, axis=0))**2)) / N
- maxS_N = np.max(np.abs(S_N))
- kStar = (np.where(np.abs(S_N) == maxS_N))[0][0]
- segSize = N
- if longRun:
- if h == 0:
- h = int(4 * (N / 100) ** (2 / 9))
- h = np.min([h, N-1])
- else:
- h = 0
- covMat = auxF.calcLRCovBasis(fdObj, h=h)
- eigCovMat = np.linalg.eigh(covMat)
- eigValsCV = eigCovMat.eigenvalues
- basis = BSplineBasis(n_basis=D)
- bridgeVals = auxF.eigValBridgeBootstrap(D, segSize, eigValsCV, numPerms=numBootstrap) # adjusted for segment size - important!
- z = np.sum((maxS_N <= bridgeVals) == True)
- pValue = z / (bridgeVals.shape)[0]
- preChangeFuncs = (fdObj[:kStar])
- preChangeMean = np.mean(preChangeFuncs)
- postChangeFuncs = (fdObj[kStar:])
- postChangeMean = np.mean(postChangeFuncs)
- deltaMeans = preChangeMean - postChangeMean
- return kStar, pValue, S_N, maxS_N, preChangeMean, postChangeMean, deltaMeans
funcChangePoint.py at commit 6934213, under MIT · at the source
Overview
- King’s College London, Department of Women & Children’s Health, London, United Kingdom
- University of Cambridge, Department of Psychology, Cambridge, United Kingdom
- University College London, Department of Medical Physics and Biomedical Engineering, London, United Kingdom
- Medical Research Council Unit The Gambia at the London School of Hygiene and Tropical Medicine, Fajara, The Gambia
Abstract
Significance: Habituation is an early-developing cognitive process linked to learning, typically reflected in functional near-infrared spectroscopy (fNIRS) studies as a reduction in evoked hemodynamic response amplitude. Conventional fNIRS analyses rely on linear time-invariance assumptions, potentially limiting insight into how responses evolve across repeated stimulus presentations.
Aim: To determine whether functional change point (FCPt) detection can characterize trial-specific changes in the infant hemodynamic response and reveal developmental differences in habituation timing.
Approach: Functional data analysis (FDA) treats entire response curves as statistical objects. Within this framework, FCPt detection identifies statistically significant structural shifts in the mean response across trials. FCPt detection with wild binary segmentation was applied to group-level infant fNIRS data (n=
Results: Significant changes were identified within auditory cortical regions. A high proportion of detected change points corresponded to decreases in response magnitude at 8 and 12 months. Weighted ordinal regression revealed an age-related shift toward earlier occurrence of decreasing change points, with older infants’ change points detected earlier within the trial sequence.
Conclusion: FCPt detection provides temporal information on the infant hemodynamic response unavailable to conventional analysis. At the group level, this additional information has revealed an age-related difference in habituation timing during the first year of life, with older infants completing habituation sooner. This represents a previously overlooked developmental change in the habituation response. Future work on individual-level data may seek to investigate these findings with greater granularity.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 8 matches between paragraphs and lines of code.
sam-beaton/fcpt
6934213b1994f8e78b5d15be0ce13d3c2436cfb7, 24 August 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
38 files
- examples/
EXAMPLEclimateFFChange.i , Jupyter, 132 linespynb - examples/
EXAMPLEclimateFPCAChange , Jupyter, 143 lines.ipynb - examples/
EXAMPLEfnirsFFChange.ipy , Jupyter, 165 linesnb - examples/
EXAMPLEfnirsFPCAChange.i , Jupyter, 339 linespynb - functions/
auxFuncChPt.py , Python, 884 lines - functions/
fNIRSData.py , Python, 1,220 lines, 1 match - functions/
funcChangePoint.py , Python, 183 lines, 2 matches - functions/
nfTranslator.py , Python, 172 lines - functions/
registerWangFunctional.p , Python, 302 linesy - functions/
sharedUtils.py , Python, 21 lines - plotting/
plotSimulatedCUSUM.ipynb , Jupyter, 66 lines, 1 match - plotting/
viewGroupCPts.ipynb , Jupyter, 478 lines, 1 match - scripts/
buildSurfAdjacencyMatric , Jupyter, 500 lineses.ipynb - scripts/
climateFFChange.ipynb , Jupyter, 132 lines - scripts/
climateFPCAChange.ipynb , Jupyter, 143 lines - scripts/
generateSimulatedHabitua , Jupyter, 263 lines, 1 matchtionData.ipynb - scripts/
getAllTrials.ipynb , Jupyter, 126 lines - scripts/
getParcelTrialsDataframe , Jupyter, 180 lines.ipynb - scripts/
groupAndIndividualCompar , Jupyter, 355 linesisons.ipynb - scripts/
groupFPCData.ipynb , Jupyter, 197 lines - scripts/
grpDotContrastsSurfParce , Jupyter, 1,457 linesl.ipynb - scripts/
grpFnirsCheckExclusion.i , Jupyter, 235 linespynb - scripts/
grpFnirsFFChange.ipynb , Jupyter, 323 lines - scripts/
grpFnirsFFCheckLRStabili , Jupyter, 419 linesty.ipynb - scripts/
grpFnirsFPCAChange.ipynb , Jupyter, 301 lines - scripts/
indDotChangeParcel.ipynb , Jupyter, 181 lines - scripts/
indDotTfceTTestSurfParce , Jupyter, 2,159 lineslSpatiotemporal4fcpt.ipy nb - scripts/
makeBrainMesh.ipynb , Jupyter, 158 lines - scripts/
plotMeshParcellation.ipy , Jupyter, 175 linesnb - scripts/
postHocMechanisticTestsH , Jupyter, 3,131 linesbO.ipynb - scripts/
postHocMechanisticTestsH , Jupyter, 3,123 linesbR.ipynb - statsScripts/
statCompareGroupCPtTFCE. , Jupyter, 526 linesipynb - statsScripts/
statGroupChangePoints.ip , Jupyter, 1,360 lines, 1 matchynb - statsScripts/
statGroupCheckHabituatio , Jupyter, 649 linesn.ipynb - statsScripts/
statIindigoIndividualCha , Jupyter, 1,942 lines, 1 matchngePoints.ipynb - statsScripts/
statIindigoIndividualCha , Jupyter, 1,719 linesngePointsChromSpecific.i pynb - LICENSE, License, 21 lines
- README.md, Text, 89 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 36 scripts, each with its path and the digest of its content;
- 8 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and Data Availability
The code used to conduct the analyses and generate the figures presented in this paper are available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 6 keywords, 4 funders, 69 references.
Cite
This paper
Beaton, S., McCann, S., Lloyd-Fox, S., Elwell, C. E., Mbye, E., Blasi Ribera, A., & Moore, S. E. (2026). Characterizing developmental changes in infant habituation using functional change point detection. Neurophotonics, 13(3), 035006. https://
BibTeX
@article{beaton2026chara
author = {Beaton, Samuel and McCann, Samantha and Lloyd-Fox, Sarah and Elwell, Clare E. and Mbye, Ebrima and Blasi Ribera, Anna and Moore, Sophie E.},
title = {{Characterizing developmental changes in infant habituation using functional change point detection}},
journal = {Neurophotonics},
year = {2026},
month = jul,
volume = {13},
number = {3},
pages = {035006},
publisher = {Society of Photo-Optical Instrumentation Engineers},
issn = {2329-423X},
doi = {10.1117/
url = {https://
pmid = {42598662},
pmcid = {PMC13472488}
}
RIS
TY - JOUR
AU - Beaton, Samuel
AU - McCann, Samantha
AU - Lloyd-Fox, Sarah
AU - Elwell, Clare E.
AU - Mbye, Ebrima
AU - Blasi Ribera, Anna
AU - Moore, Sophie E.
TI - Characterizing developmental changes in infant habituation using functional change point detection
T2 - Neurophotonics
J2 - Neurophotonics
PY - 2026
DA - 2026/
VL - 13
IS - 3
SP - 035006
SN - 2329-423X
PB - Society of Photo-Optical Instrumentation Engineers
DO - 10.1117/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1117/
"type": "article-journal",
"title": "Characterizing developmental changes in infant habituation using functional change point detection",
"container-title": "Neurophotonics",
"author": [
{
"family": "Beaton",
"given": "Samuel"
},
{
"family": "McCann",
"given": "Samantha"
},
{
"family": "Lloyd-Fox",
"given": "Sarah"
},
{
"family": "Elwell",
"given": "Clare E."
},
{
"family": "Mbye",
"given": "Ebrima"
},
{
"family": "Blasi Ribera",
"given": "Anna"
},
{
"family": "Moore",
"given": "Sophie E."
}
],
"container-title-short":
"volume": "13",
"issue": "3",
"page": "035006",
"DOI": "10.1117/
"PMID": "42598662",
"PMCID": "PMC13472488",
"ISSN": "2329-423X",
"publisher": "Society of Photo-Optical Instrumentation Engineers",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pone.0358044 [code]
- An exploratory fNIRS study on directional asymmetry in segmental discrimination: Lateral-rhotic (/
la-ra/ ) and labial-dorsal (/ ba-ga/ ) contrasts tested in 5- and 9-month-old Japanese infants. Journal: PloS oneIn common: seaborn, pandas, SciPy, 2 other tools, fNIRS, developmental, 6 references - [2] doi:10.1162/imag.a.1208 [code]
- Brain network analysis in Alzheimer's disease and mild cognitive impairment using high-density diffuse optical tomography.Journal: Imaging neuroscience (Cambridge, Mass.)In common: NetworkX, statsmodels, seaborn, 4 other tools, fNIRS, 5 references
- [3] doi:10.1117/1.nph.13.2.025001 [code]
- Surface-based image reconstruction optimization for high-density functional near-infrared spectroscopy.Journal: NeurophotonicsIn common: NetworkX, scikit-image, h5py, 7 other tools, fNIRS, 2 references
- [4] doi:10.1002/alz.71649 [code]
- Postmortem brain MRI reveals differential associations of subcortical and limbic volumes with cortical thinning and neurodegenerative pathologies.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: statannotations, ANTs, Plotly, 8 other tools
- [5] doi:10.1162/imag.a.1276 [code]
- High-resolution whole-brain magnetic resonance spectroscopic imaging in youth at risk for psychosis.Journal: Imaging neuroscience (Cambridge, Mass.)In common: ANTs, NetworkX, Plotly, 7 other tools, 1 reference
- [6] doi:10.21203/rs.3.rs-9326213/v1 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: Research Square (preprint)In common: statannotations, ANTs, Plotly, 7 other tools
- [7] doi:10.64898/2026.03.09.710558 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: bioRxiv (preprint)In common: statannotations, ANTs, Plotly, 7 other tools
- [8] doi:10.1073/pnas.2505464123 [code]
- Opioid-specific brain connectivity dynamics distinguish analgesia from secondary effects: Studies in male mice.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: scikit-posthocs, NetworkX, h5py, 7 other tools
- [9] doi:10.1117/1.nph.12.2.025011 [code]
- NIRSTORM: a Brainstorm extension dedicated to functional near-infrared spectroscopy data analysis, advanced 3D reconstructions, and optimal probe designJournal: n/aIn common: Matplotlib, NumPy, fNIRS, 6 references
- [10] doi:10.3389/fncom.2026.1786996 [code]
- Schumann-anchored golden ratio organization of human neural oscillations.Journal: Frontiers in computational neuroscienceIn common: NetworkX, h5py, NiBabel, 6 other tools, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 36 scripts, and 8 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:fc9d024b3986290b…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
