Skip to content

Instantly share code, notes, and snippets.

View mlaib's full-sized avatar
:octocat:

Mohamed Laib mlaib

:octocat:
View GitHub Profile
# Suggestion plots using plotly library ####
# library(MFDFA)
# mfdfa<-MFDFA(tsx, scale, m, q) # mfdfa: contains all outputs
library(plotly)
# Supplementary functions ####
poly_fit<-function(x,y,n){
formule<-lm(as.formula(paste('y~',paste('I(x^',1:n,')', sep='',collapse='+'))))
@mlaib
mlaib / MFDFA2.R
Created August 23, 2018 07:02
MultiFractal Detrended Fluctuation Analysis: parallel version
library(MFDFA)
library(foreach)
library(doParallel)
MFDFA2<-function (tsx, scale, m = 1, q) {
poly_fit.val<-function (x, y, n) {
formule <- lm(as.formula(paste("y~", paste("I(x^", 1:n, ")",
sep = "", collapse = "+"))))
res1 <- coef(formule)

Keybase proof

I hereby claim:

  • I am mlaib on github.
  • I am mlaib (https://keybase.io/mlaib) on keybase.
  • I have a public key ASDOIr5otLR_Kr-qXPD10q9DHh3S0q6WY8l0FLJb4NIbfgo

To claim this, I am signing this object:

@mlaib
mlaib / UnilNet_K.py
Last active June 12, 2019 10:06
UnilNet_K.py
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 12:27:25 2017
@author: mlaib
"""
import numpy as np
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
@mlaib
mlaib / MFDFA_plot.R
Last active September 11, 2018 07:25
##################################
## Suggestion of output plot: ####
##################################
## Supplementary functions: #####
reset <- function(){
par(mfrow=c(1, 1), oma=rep(0, 4), mar=rep(0, 4), new=TRUE)
plot(0:1, 0:1, type="n", xlab="", ylab="", axes=FALSE)}
poly_fit<-function(x,y,n){
@mlaib
mlaib / MFDFA_Tuto.R
Last active January 25, 2018 08:33
Notes for MFDFA R library
## MFDFA package installation: from github ####
install.packages("devtools")
devtools::install_github("mlaib/MFDFA")
library(MFDFA)
#####
a<-0.9
N<-1024
tsx<-MFsim(N,a)
scale=10:100
q<--10:10