mmaechler / fracdiff Goto Github PK
View Code? Open in Web Editor NEWR package for Fractionally Differenced ARIMA aka ARFIMA(P,d,q) Time Series Models
R package for Fractionally Differenced ARIMA aka ARFIMA(P,d,q) Time Series Models
fracdiff Maximum likelihood estimation of the parameters of a fractionally differenced ARIMA (p,d,q) model. For long-memory dependence in time series. (Haslett and Raftery, Applied Statistics 38, 1989, 1-50). See the help files for details. The original S/S-plus package by Chris Fraley, Department of Statistics, University of Washington, has been converted for usage with R; see README.orig, also for copyright. I've converted all single precision floats to double precision (both in the R file and the Fortran sources), as R didn't support single precision (in 1999). Fritz Leisch, TU Wien, Austria ------------ The package was _orphaned_ in Summer 2003, and after asking Fritz and Chris Fraley, I have become the new maintainer in December 2003. I've managed to locate and eradicate the bug leading to wrong hessian, covariance and correlation matrix estimates. Martin Maechler, ETH Zurich, Switzerland ------ See the files ./TODO and ./Done and ./ChangeLog on TODOs and ideas See the file ./Calling (and then src/ftn-struc) about code organization ~~~~~~~~~
I am reading De Prados book on Ml in finance. There is a section on applying fracdiff on fin time series to make it stationary. Here is one implementation in python https://github.com/philipperemy/fractional-differentiation-time-series
I would like to know would I get the same result if I use frac diff witn no ar and ma terms?
Error while installing fracdiff with R
Installing fracdiff [1.5-2] ...
FAILED
Error installing package 'fracdiff':
====================================
* installing *source* package ‘fracdiff’ ...
** package ‘fracdiff’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fdcore.c -o fdcore.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fdgam.c -o fdgam.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fdhess.c -o fdhess.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fdmin.c -o fdmin.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fdsim.c -o fdsim.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-BNt0N4/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c pmult.c -o pmult.o
gcc -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o fracdiff.so fdcore.o fdgam.o fdhess.o fdmin.o fdsim.o init.o pmult.o -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: fracdiff.so] Error 1
ERROR: compilation failed for package ‘fracdiff’
* removing ‘/home/kon*****/****/***/****/renv/staging/1/fracdiff’
Error: install of package 'fracdiff' failed [error code 1]
R version
- R version 4.2.2 (2022-10-31)
System info
Inspiron-5502 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linu
diffseries(x,d) incorrectly calculates the fractional derivative for d = 0.5 (and probably for all d). This is probably due to the use of circular convolution with FFT. A simple example below shows this problem
n=20
x=1:n
ts.plot(2*sqrt(x/pi),ylim=c(-10,5)) # analytical solution
lines(fracdiff::diffseries(x,0.5),col="blue") # test fractional derivative #approximation
k=1:(n-1)
wts = c(1,cumprod ((k-0.5-1)/k))
padx=c(rep(0,n),x)
frac = stats::filter(padx,wts,sides=1);
frac_circ = stats::convolve(x,wts,FALSE,type="circular");
points(frac[-(1:n)])
points(frac_circ,col="blue")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.