My problem is that I have data (2D coordinates) which I would like to generate more of. To solve my problem, I wanted to do a kernal density estimate and use it to both plot a heatmap and generate more data (which would generate data, which itself should create a similar heatmap).
I have a probability density estimate f which was returned from ksdensity(). The code I used to get f was
[f, xi, bw] = ksdensity(data, [X(:) Y(:)]);
where [X(:) Y(:)] was used to create my own grid covering my data. The data itself is a 2-column matrix, with each row representing a x- and y-coordinate.
f is a 20000x1 vector, which I could reshape and create a heatmap from. What I would like to do instead is using f somehow to generate new values from the probability density estimate which has been made over my data.
Do I need to use the bandwidth bw somehow?
Thank you for the help!