wittawatj / kernel-gof

NeurIPS 2017 best paper. An interpretable linear-time kernel goodness-of-fit test.
MIT License
66 stars 16 forks source link

can this algorithm compare differences in two matrices #5

Open andrewczgithub opened 4 years ago

andrewczgithub commented 4 years ago

hi @wittawatj !!

i hope your well.

I was wondering if you have a matrix of returns, then new data comes in and you have a second rolling matrix of returns, can the test tell if the distribution has changed from one matrix to the next?

Kind regards, Andrew

wittawatj commented 4 years ago

Could you please elaborate more? I do not quite understand your setting. Is it a change point detection problem? Do you have a time series of matrices?

andrewczgithub commented 4 years ago

Hi @wittawatj !

Basically i was thinking of testing weather warket conditions have changed. Using the test as test for portfolio rebalancing.

If you have an array of returns and you update the array with new returns, then you work out if the distribution has changed and hence the portfolio needs to be rebalanced.

Kind regards and thanks, Andrew

wittawatj commented 4 years ago

Hi Andrew,

Indeed, this sounds like a change point detection problem https://en.wikipedia.org/wiki/Change_detection . Tools in this repository are for goodness-of-fit testing for i.i.d. data. That is, given a model (probability density), and a dataset, decide whether the model fits.

I think the tools we have here are not appropriate for your problem. Firstly, it does not sound like you have a density model to begin with i.e., you only have observations. Secondly, what you have is probably not i.i.d. I would encourage you to look at change point detection.

Best, Wittawat

andrewczgithub commented 4 years ago

oops! thanks so much for your advice

andrewczgithub commented 4 years ago

could you possibly give me an example of how change point could help with the above problem?