How do I generate samples from multivariate kernel density estimated distribution?

11 ビュー (過去 30 日間)
Unlike the univariate counterpart, there is no documentation for how to draw random samples from a multivariate kernel density estimation, as obtained from mvksdensity.
One possibility would be to query the mvksdensity at uniform random points, and accept the samples with the right probability.
Presumably one could replicate the estimated density using gmdistribution, with the number of components equal to the number of samples used in the kernel density estimation. But what is the right variance to use, and how does this relate to the bandwidth parameter used in mvksdensity?

採用された回答

Linus Schumacher
Linus Schumacher 2018 年 8 月 6 日
Ok, I've found the answer. The right sigma to use for gmdistribution seems to be bandwidth.^2
  3 件のコメント
Sterling Baird
Sterling Baird 2020 年 8 月 12 日
Do you have a reference for using bw.^2 ?
Linus Schumacher
Linus Schumacher 2020 年 8 月 13 日
I can't remember, I either looked this up in the Matlab documentation, or tried it out with different bandwidth to make sure gmdistribution gives me the same results as mvksdensity – probably the latter

サインインしてコメントする。

その他の回答 (1 件)

Thomas Alderson
Thomas Alderson 2020 年 6 月 17 日
How to do this?
  1 件のコメント
Linus Schumacher
Linus Schumacher 2020 年 6 月 18 日
To sample from the KDE I built my own using gmdistribution, with one Gaussian distribution for each sample, and the standard deviation = bandwidth.^2

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by