Updated example in TKDE

master
per.andreas.brodtkorb 14 years ago
parent b5835a7549
commit 1484f9128e

@ -103,12 +103,12 @@ class TKDE(object):
... 1.09547561, 1.01671133, 0.73211143, 0.61891719, 0.75903487,
... 1.8919469 , 0.72433808, 1.92973094, 0.44749838, 1.36508452])
>>> x = np.linspace(0, max(data.ravel()) + 1, 10)
>>> kde = wk.TKDE(data, hs=0.5, alpha=0.5, L2=0.5)
>>> x = np.linspace(0.01, max(data.ravel()) + 1, 10)
>>> kde = wk.TKDE(data, hs=0.5, L2=0.5)
>>> f = kde(x)
>>> f
array([ 0.0541248 , 0.16555235, 0.33084399, 0.45293325, 0.48345808,
0.48345808, 0.45293325, 0.33084399, 0.16555235, 0.0541248 ])
array([ 1.03982714, 0.45839018, 0.39514782, 0.32860602, 0.26433318,
0.20717946, 0.15907684, 0.1201074 , 0.08941027, 0.06574882])
import pylab as plb
h1 = plb.plot(x, f) # 1D probability density plot

Loading…
Cancel
Save