0

I would like to compute a "generalization of the Pearson correlation coefficient", the nth- comomentum that could work for n time series.

In short, I would like to have a function that receives n different time series and: for n=2 gives me the Pearson correlation coefficient between two time series; for n=3 gives the coskew between three different time series, for n=4 gives the cokurtosis between 4 different time series, and so on. A good starting point is already in the post: how to calculate coskew and cokurtosis . However, in this previous post, It is only considered coskew and cokurtosis between two different time series.

Thanks a lot for the help!

  • 1
    Hi Fernando, welcome to SO. First of all, the post you linked gives you the coskewness between `X,X,Y`. It looks trivial to just do `X,Y,Z`.. Where are you stuck? Have you tried any code? Please take a look at [How To Ask](https://stackoverflow.com/help/how-to-ask). The case for `n=2` is trivial, just google `pd corr`. The case for `n=4` is also in the link you provided, just use four random variables instead of repeating `X` – rafaelc Apr 05 '19 at 12:17
  • Thanks for your post RafaelC! It's not trivial for me, but If it is for you, can you come with a code including the extension? Yet, my question would be on the implementation for higher orders, i.e, with n terms. Do you have any idea? Thank you, Fernando – Fernando Apr 05 '19 at 13:31
  • I didn't mean to say "trivial" in a bad way. I am just saying that it is very likely that, if you give it a try, you'll get it. I say that because the idea of stack overflow is not to be a "*coding service*", but rather to help people struggling with code. So coming here and saying "hi, I want this, could you give me the code?" is not the point of the website. Rather, you can try a solution, specify where you are stuck, and then we can help you through the way ;} – rafaelc Apr 05 '19 at 14:25

0 Answers0