Code Monkey home page Code Monkey logo

Comments (2)

sbuergers avatar sbuergers commented on September 15, 2024

I think it is a good idea. There is generally not a lot of functionality in the exploration module, as it did not have priority.

It might become a challenge to create consistency in this module though...

Please check the existing functions to avoid any overlap etc. Also I once created this function for another project, although it is not the most difficult function :D

def find_delay(datax, datay, lag_range, absolute=False):
"""Find the delay between two time series.

Parameters
----------
datax : pd.Series
    Time series x
datay : pd.Series
    Time series y
lag_range : list
    Range of lags to search for delay
absolute : bool (default False)
    If True, return the absolute value of correlation to find the delay

Returns
-------
delay : int
    Delay between x and y
corr : float
    Strongest correlation between x and y
"""
corr = [datax.shift(x).corr(datay) for x in lag_range]
if absolute:
    corr = [abs(x) for x in corr]
return lag_range[np.argmax(corr)], corr[np.argmax(corr)]

from sam.

sbuergers avatar sbuergers commented on September 15, 2024

We are not sure if we want to incorporate this into SAM at this point. Once we find another use case we might. For now, not merging and putting on hold!

from sam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.