knockpy icon indicating copy to clipboard operation
knockpy copied to clipboard

HMM Knockoffs, and Custom Sampler

Open cruyffturn opened this issue 3 years ago • 1 comments

Hello,

Is the HMM Knockoff sampler already implemented? If not can we write a custom knockoff sampler?

Thank you!

cruyffturn avatar May 12 '21 22:05 cruyffturn

Hi there!

The knockpy.metro.MetropolizedKnockoffSampler class can accommodate arbitrary HMM models. If you implement a function which returns the log-likelihood of the data under the HMM, you can pass it into the MetropolizedKnockoffSampler class to sample valid knockoffs. If you're working with discrete data, you can use the ``buckets" argument to specify the discrete support. See the docs for more details and/or let me know if you have questions.

Note that this class implements the covariance-guided knockoff construction outlined in https://arxiv.org/pdf/1903.00434.pdf. If you are interested in generating knockoffs for an HMM using Sequential Conditional Independent Pairs (as in https://arxiv.org/pdf/1706.04677.pdf), knockpy does not support this yet, but you are welcome to implement one either from scratch or by wrapping the metro classes! I'll probably get to it eventually, but probably not too soon :)

amspector100 avatar May 15 '21 05:05 amspector100