compactly_supported_normal
compactly_supported_normal(x, n=2, sigma=1.0, center=None, second_derivative=-1)
Approximated compact Gaussian density functiona
This computes a compactly supported approximation of a Gaussian density function by convolving a box filter with itself n times in each dimension and multiplying, as described in "Poisson Surface Reconstruction" by Kazhdan et al. 2006.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
(nx,dim) numpy double array
|
Coordinates where the function is to be evaluated |
required |
n |
int, optional (default 2)
|
Number of convolutions (between 1 and 4), a higher number will more closely resemble a Gaussian but have broader support |
2
|
sigma |
double, optional (default 1.0)
|
Scale / standard deviation function (bigger leades to broader support) |
1.0
|
center |
Coordinates where the function is centered (i.e., distribution mean). If None, center at the origin. |
None
|
|
second_derivative |
(int, optional(default - 1))
|
If greater or equal than zero, this is the index of the dimension along which to compute the second partial derivative instead of the pure density. |
-1
|
Returns:
Name | Type | Description |
---|---|---|
v |
(nx,) numpy double array
|
Values of compacly supported approximate Gaussian function at x |
Examples:
from gpytoolbox import compactly_supported_normal
import matplotlib.pyplot as plt
x = np.reshape(np.linspace(-4,4,1000),(-1,1))
plt.plot(x,compactly_supported_normal(x, n=4,center=np.array([0.5])))
plt.plot(x,compactly_supported_normal(x, n=3,center=np.array([0.5])))
plt.plot(x,compactly_supported_normal(x, n=2,center=np.array([0.5])))
plt.plot(x,compactly_supported_normal(x, n=1,center=np.array([0.5])))
plt.show()
Source code in src/gpytoolbox/compactly_supported_normal.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|