File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ version = "0.5.1"
5
5
6
6
[deps ]
7
7
Distributions = " 31c24e10-a181-5473-b8eb-7969acd0382f"
8
+ DocStringExtensions = " ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
8
9
FFTW = " 7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
9
10
Interpolations = " a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
10
11
Optim = " 429524aa-4258-5aef-a3af-852621145aeb"
Original file line number Diff line number Diff line change 1
1
module KernelDensity
2
2
3
+ using DocStringExtensions: TYPEDEF, FIELDS
3
4
using StatsBase
4
5
using Distributions
5
6
using Optim
Original file line number Diff line number Diff line change 1
- # Store both grid and density for KDE over R2
1
+ """
2
+ $(TYPEDEF)
3
+
4
+ Store both grid and density for KDE over the real line.
5
+
6
+ Reading the fields directly is part of the API, and
7
+
8
+ ```julia
9
+ sum(density) * step(x) * step(y) ≈ 1
10
+ ```
11
+
12
+ # Fields
13
+
14
+ $(FIELDS)
15
+ """
2
16
mutable struct BivariateKDE{Rx<: AbstractRange ,Ry<: AbstractRange } <: AbstractKDE
17
+ " First coordinate of gridpoints for evaluating the density."
3
18
x:: Rx
19
+ " Second coordinate of gridpoints for evaluating the density."
4
20
y:: Ry
21
+ " Kernel density at corresponding gridpoints `Tuple.(x, permutedims(y))`."
5
22
density:: Matrix{Float64}
6
23
end
7
24
Original file line number Diff line number Diff line change 1
- # Store both grid and density for KDE over the real line
1
+ """
2
+ $(TYPEDEF)
3
+
4
+ Store both grid and density for KDE over ``ℝ²``.
5
+
6
+ Reading the fields directly is part of the API, and
7
+
8
+ ```julia
9
+ sum(density) * step(x) ≈ 1
10
+ ```
11
+
12
+ # Fields
13
+
14
+ $(FIELDS)
15
+ """
2
16
mutable struct UnivariateKDE{R<: AbstractRange } <: AbstractKDE
17
+ " Gridpoints for evaluating the density."
3
18
x:: R
19
+ " Kernel density at corresponding gridpoints `x`."
4
20
density:: Vector{Float64}
5
21
end
6
22
You can’t perform that action at this time.
0 commit comments