JuliaStats / KernelDensity.jl

Kernel density estimators for Julia
Other
172 stars 40 forks source link

which is x and which is y? #111

Open EthanRLeonard opened 1 year ago

EthanRLeonard commented 1 year ago

Hey, love this package, and want to make sure I'm understanding how it works.

For a bivariate kernel density, if you sum down a column, then multiply by the x step distance, does that equal the marginal probability of the x variable taking that sliver of range? For example:

$chf,eur \in R^n$

B1 = kde((chf,eur))

x_step = B1.x[2]-B1.x[2]

marginal_probability_1 = sum(B1.density[:,1] .* x_step)

Is the following statement true?

$$ \text{marginal probability 1}= P(X[1] \leq X \leq X[2]) $$

Or should I be using y_step to calculate marginal probability 1?

Sorry for the (maybe too simplistic) question. I appreciate any help you're willing to provide.