{"id":19252275,"url":"https://github.com/sccn/arfitstudio","last_synced_at":"2025-10-26T15:03:29.457Z","repository":{"id":150759148,"uuid":"327720113","full_name":"sccn/ARfitStudio","owner":"sccn","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-25T21:49:23.000Z","size":434,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-05T06:43:06.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-07T20:40:09.000Z","updated_at":"2024-07-25T21:49:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f02f5f6-b2e5-45f8-b05c-9beade1f3459","html_url":"https://github.com/sccn/ARfitStudio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FARfitStudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FARfitStudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FARfitStudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FARfitStudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/ARfitStudio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347944,"owners_count":19787236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:26:13.220Z","updated_at":"2025-10-26T15:03:24.429Z","avatar_url":"https://github.com/sccn.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"What is ARfitStudio?\n-------------------\n\nFirst of all, ARfit is a collection of Matlab modules developed by Tapio\nSchneider and Arnold Neumaier for estimating parameters of multivariate\nautoregressive (AR) models, diagnostic checking of fitted AR models, and\nanalyzing eigenmodes of fitted AR models. This plugin, ARfitStudio, uses\nit so that one can interactively clean TMS-induced short-burst (5-10 ms)\nartifacts and so on. The nature of the artifact does not matter (could\nbe spikes by artifact, could be zeros, NaNs, etc), as long as the\nartifact duration is short and they are correctly marked. It has\nstrength on the following points.\n\n-   To perform quick (e.g. smart epoching \u0026 integration to continuous\n    data using mcolon(); before and after correction comparison with one\n    click, etc) and intuitive (e.g. training, correction, and blending\n    windows overlaid on grand-median ERPs) correction of spiky\n    artifacts.\n-   Immediately usable after importing the continuous data; it is the\n    very first stage of the preprocess pipeline.\n\nThis plugin is dependent on ARfit and mcolon. ARfit can be installed by\ninstalling SIFT from EEGLAB plugin manager. To use mcolon(), users\nshould compile the mex file.\n\n\u003chttp://www.mathworks.com/matlabcentral/fileexchange/174-arfit\u003e\n\u003chttp://www.mathworks.com/matlabcentral/fileexchange/29854-multiple-colon/content/mcolonFolder/mcolon.m\u003e\n\nWhy ARfitStudio?\n---------------\n\nIf there are spike artifacts with high amplitude, we cannot filter the\ndata (because spikes spread in the time domain). In certain situation,\nit is more important to make them harmless for the sake of data process,\nrather than recovering the underlying signals (the latter is often\nimpossible). This plugin provides a solution for it.\n\nHow it works\n------------\n\nIt learns autoregressive model from the training period (green), which\nis the past of the spike, to make a prediction to replace problematic\nspike data points (red). For smooth connection, one can also set\noptional blending period (light magenta) during which predicted signal\nand original signals are gradually mixed with a linear slope. Thus,\n*this plugin replaces the bad data points using the past information*\n(therefore temporal interpolation). It does NOT recover the signal under\nthe noise. One can select multiple markers for correction. In the main\nplot, grand-median ERPs for all the channels are shown. To save the\nresult, just save the EEG dataset (do not check 'restore the last data'\nfor this!)\n\nScreenshots\n-----------\n\n![300px\\|Figure 1. interpolateSpike:\nGUI](images/Screenshot3_interpolatespike.png)\n\n![600px\\|Figure 2. interpolateSpike: Before\ncorrection](images/Screenshot2_interpolatespike.png)\n\n![600px\\|Figure 3. interpolateSpike: After\ncorrection](images/Screenshot1_interpolatespike.png)\n\nData by courtesy of Michael Borich\n\nIf you want to use ICA for the final analysis\n---------------------------------------------\n\nBecause this ARfit-based interpolation is performed for the same time\npoints across channels, ICA cannot decompose this period. As a result,\nyou'll see strange spikes in IC activations (i.e., EEG.icaact) during\nthe correction windows. In the plots below, I show 1) ERP of IC\nactivation for 33ch with ARfitStudio applied on channels (left), 2) the\nsame but ARfitStudio applied on ICs (right). The noise was originally\npresent within -/+10 ms relative to latency zero.\n\n![Onchannels.png](images/Onchannels.png)\n![Onics.png](images/Onics.png)\n\nPerforming ARfit-interpolation for ICA properly is complicated.\n\n1.  Import data.\n2.  Perform ARfitStudio on channels.\n3.  Preprocess the data (high-pass filter, CleanLine plugin,\n    clean_rawdata plugin, average referencing, AMICA plugin, DIPFIT\n    plugin, fitTwoDipoles plugin). Note that you need to exclude the\n    interpolated data from ICA process (those have no multivariate\n    property across channels, so not decomposable).\n4.  Perform ARfitStudio on IC activations.\n5.  Backproject interpolated IC activation to reconstruct channel data.\n\nNote that the ARfitStudio is used twice, and the first application is\npurposed only for various filters, not even for ICA. In this way, you\ncan obtain both clean channel signals and IC activations. For detail,\nsee 'batchDemoForICA.m' included in the download package. I recommend\nyou take a look because there are several cumbersome steps you have to\ngo through.\n\nNote for batch users (03/11/2019 updated)\n-----------------------------------------\n\nIf one wants to run the process as a batch,\n\n1.  Use EEGLAB function pop_epoch() to crop out peri-event data points.\n    Note all the negative latencies will be used as a learning period\n    for ARfit.\n2.  Use arfit2interpolate(). Note that the last input\n    'last_n_pointsToBlend' does NOT specify the additional length to\n    the data points to the main interpolation window (as the GUI\n    operation indicates), but it actually specifies the last data points\n    of the main interpolation window. For example, outputData =\n    arfit2interpolate(EEG.data, \\[80 95\\], 5) means, \\[80:90\\] for 100%\n    interpolation, and \\[91:95\\] is blended with \\[83% 67% 50% 33% 17%\\]\n    interpolated data blended with \\[17% 33% 50% 67% 83%\\] of the\n    original data, respectively.\n3.  Use putBackEpoch2Continuous() to re-construct the corrected, epoched\n    data to the continuous data.\n\nReference\n---------\n\nA. Neumaier and T. Schneider, 2001: Estimation of parameters and\neigenmodes of multivariate autoregressive models. ACM Trans. Math.\nSoftw., 27, 27-57.\n\nT. Schneider and A. Neumaier, 2001: Algorithm 808: ARfit – A Matlab\npackage for the estimation of parameters and eigenmodes of multivariate\nautoregressive models. ACM Trans. Math. Softw., 27, 58-65.\n\nAuthors: Makoto Miyakoshi and Tim Mullen. SCCN, INC, UCSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Farfitstudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Farfitstudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Farfitstudio/lists"}