Library: | pp |
See also: | ppftind |
Quantlet: | ppsj1ind | |
Description: | computes the Sibson Jones index which considers the deviations from the normal density for univariate data. |
Usage: | ind = ppsj1ind(px) | |
Input: | ||
px | n x 1 matrix containing the projected data | |
Output: | ||
ind | scalar, the corresponding Sibson Jones index |
; loads the library pp library("pp") ; initialize random generator randomize(0) ; generate a dataset with mean(x)=0 and var(x)=1 x = normal(100) ; compute the index with Scott's rule ppsj1ind(x)
Contents of ind [1,] 0.0038037
proc() = plotindex1(x) n = 50 phi = grid(0, 2*pi/n, n) ind = NaN*matrix(n) i = 0 while(i<n) i = i+1 xp = x * #(cos(phi[i]), sin(phi[i])) ind[i] = ppsj1ind(xp) line(phi~ind) endo endp ; load the library pp and plot library("pp") library("plot") ; read the banknote data x = read("bank2") ; select the fourth and sixth column and ; sphere the data x = transform(x[,4|6], grc.prep.sphere) ; generate the index function for 1D projection plotindex1(x)
We see the plot of the index function in dependence of the projection vector. The projection vector is parametrized by the angle phi. Since the projection vector v and -v generate the same projection, we see the index function doubled. Note that the maxima at phi=1,76 and phi=2,8 represent the "most" interesting projections.