Skip to content

Commit 12edb91

Browse files
committed
increase default resolution of BivariateKDE, allow AbstractVectors to be used
1 parent fe905ee commit 12edb91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bivariate.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ end
8383
function kde(data::(RealVector, RealVector), dist::BivariateDistribution;
8484
boundary::((Real,Real),(Real,Real)) = (kde_boundary(data[1],std(dist[1])),
8585
kde_boundary(data[2],std(dist[2]))),
86-
npoints::(Int,Int)=(128,128))
86+
npoints::(Int,Int)=(256,256))
8787

8888
xmid = kde_range(boundary[1],npoints[1])
8989
ymid = kde_range(boundary[2],npoints[2])
@@ -103,7 +103,7 @@ function kde(data::(RealVector, RealVector);
103103
kernel=Normal,
104104
boundary::((Real,Real),(Real,Real)) = (kde_boundary(data[1],bandwidth[1]),
105105
kde_boundary(data[2],bandwidth[2])),
106-
npoints::(Int,Int)=(128,128))
106+
npoints::(Int,Int)=(256,256))
107107

108108
dist = kernel_dist(kernel,bandwidth)
109109
xmid = kde_range(boundary[1],npoints[1])

src/univariate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ kernel_dist{D}(::Type{D},w::Real) = (s = w/std(D(0.0,1.0)); D(0.0,s))
1313

1414

1515
# Silverman's rule of thumb for KDE bandwidth selection
16-
function default_bandwidth(data::Vector{Float64}, alpha::Float64 = 0.9)
16+
function default_bandwidth(data::RealVector, alpha::Float64 = 0.9)
1717
# Determine length of data
1818
ndata = length(data)
1919
ndata <= 1 && return alpha

0 commit comments

Comments
 (0)