{"id":18928814,"url":"https://github.com/cnelias/detrendedfluctuationanalysis.jl","last_synced_at":"2025-04-15T14:31:37.610Z","repository":{"id":132278257,"uuid":"141255034","full_name":"CNelias/DetrendedFluctuationAnalysis.jl","owner":"CNelias","description":"Module for DFA and DFA2D computations.","archived":false,"fork":false,"pushed_at":"2019-02-11T21:11:41.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T22:34:44.498Z","etag":null,"topics":["dfa","julia","time-series"],"latest_commit_sha":null,"homepage":"","language":"Julia","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/CNelias.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":"2018-07-17T08:14:01.000Z","updated_at":"2022-04-25T14:41:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fb434fc-91d7-4acd-bc5b-a9db5367a8d1","html_url":"https://github.com/CNelias/DetrendedFluctuationAnalysis.jl","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/CNelias%2FDetrendedFluctuationAnalysis.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CNelias%2FDetrendedFluctuationAnalysis.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CNelias%2FDetrendedFluctuationAnalysis.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CNelias%2FDetrendedFluctuationAnalysis.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CNelias","download_url":"https://codeload.github.com/CNelias/DetrendedFluctuationAnalysis.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249088785,"owners_count":21210863,"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":["dfa","julia","time-series"],"created_at":"2024-11-08T11:28:07.609Z","updated_at":"2025-04-15T14:31:37.591Z","avatar_url":"https://github.com/CNelias.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":" **Travis**     \n:--------:\n[![Build Status](https://travis-ci.com/johncwok/DetrendedFluctuationAnalysis.jl.svg?branch=master)](https://travis-ci.com/johncwok/DetrendedFluctuationAnalysis.jl)\n\nDetrended Fluctuation Analysis (DFA)\n=============================================\n\nA module to perform detrended fluctuation analysis, which also gives the possibility to analyse the correlations between two time series \n(sometimes called the DCCA or DFA2D method). \nThe DFA allows one to study correlations in data, without disturbance of seasonality or trend.\n\nThe implementation is based, among others, on this article:\n*Podobnik B Stanley H . Detrended cross-correlation analysis: A new method for analyzing two nonstationary time series (2008)*         DOI : 10.1103/PhysRevLett.100.084102\n\n### Installation :\n\nIn Julia, enter :\n\n```julia\njulia\u003e using Pkg\nPkg.clone(\"https://github.com/johncwok/DetrendedFluctuationAnalysis.jl.git\")\n```\nand then :\n\n```julia\njulia\u003e using DetrendedFluctuationAnalysis\n```\n\nYou are now ready to call and use the function DFA() !\n\n### Perform a 2D DFA computation :\n\nCall the DFA function DFA(data1,data1,box_b::Int,box_s::Int,nb_pt::Int,step::Int)\n\nthe arguments have the following meaning :\n* data1, data2 : the first  and second time series of data to analyse\n* box_b, box_s : the starting and ending point of the analysis. It's recommended for box_s not to be to big in comparison to \nthe total length of the time-series, otherwise you'll get artefacts. Stopping at a box_s roughly equal to 1/4 of the total length \nis a good idea.\n* nb_pt : the number of points you want to perform the analysis onto. \n* step : the parameter commanding the overlap between the windows during the avering process. (a value of 20 is good).\n\nIt returns :\n* the list of points where the analysis was performed\n* the value of the fluctuation coefficient at each of these points\n\n### Perform a traditional DFA computation :\n\nSimply feed the DFA function with the same time serie twice (in other words data1 and data2 needs to be provided with the same time serie)\nthe rest is identical to a 2D DFA computation !\n\n### Example of DFA (1D) :\n\nCalling the DFA function with white noise,\n\n```julia\njulia\u003e a = rand(1000)\nx,y = DFA(a,a,20,200,30,20)\n```\nwill give the following plot :\n\n```julia\nusing PyPlot\n\nplot(x,y,\"bo-\",markersize = 4);      \ntitle(\"DFA analysis of white noise\")\nlegend()\nxscale(\"log\")\nyscale(\"log\")\nxlabel(\"Log(s)\")\nylabel(\"Log(F(n))\")\n\n# the following lines are here to perform the linear fit of the results\n# in order to get the exponent alpha\na = linreg(log.(x),log.(y))[2]\nb = linreg(log.(x),log.(y))[1] \nplot(x,exp(b)*x.^a, color = \"black\",linestyle = \":\", label = string(L\"fit. exponant $\\alpha$ = \", a))\n```\n\n![index](https://user-images.githubusercontent.com/34754896/42929947-e085364e-8b3b-11e8-80d9-98e863ad9744.png)\n\n\nRequirements\n------------\n\n* Polynomials\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnelias%2Fdetrendedfluctuationanalysis.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnelias%2Fdetrendedfluctuationanalysis.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnelias%2Fdetrendedfluctuationanalysis.jl/lists"}