Back to Community
Spearman Rank Corr Significance?

Running an algo that produces a 1(buy) or 0(don't buy). Regressing the signal to the 1 month returns gets me this information coeffecient with p-value.

stats.spearmanr(trade_signal, returns(t+1))

SpearmanrResult(correlation=0.10973707695978797, pvalue=0.087827598637704313)

Is this p-value too low?

if I change it to a 1 year rolling return the results are much more significant, but is this correct?

Any help is much appreciated.


1 response

This is much easier in pipeline.

spy_correlations = RollingSpearmanOfReturns(
target=sid(8554), returns_length=5, correlation_length=21,
) This would give you the spearnman with rolling means of 5 days over 1 month of days traded.

If you have only a few assets. You can use StaticAssets and select only a few assets.

Not quite sure if it is what you are looking for.