Hi all,
I want to know how to generate new data points according to the density function using AlgebraOfGraphics.density(). As the following code shows, I used AlgebraOfGraphics.density() to fit datasets and visualized data distribution. Further I wanted to sampled more data from the fitted distribution, is there any way to do so? Thanks!
using AlgebraOfGraphics
using Distributions
using DataFrames
using CairoMakie
dx = Normal(20,1)
dy = Normal(25,1)
x = rand(dx, 50)
y = rand(dy, 50)
dn2 = DataFrame(x = x, y = y)
p1 = data(dn2) * mapping([:x, :y] .=> "variables") *
AlgebraOfGraphics.density() *
mapping(color = dims(1) => renamer(["x", "y"]))
draw(p1,axis = (width = 200, height = 200))