Description Usage Arguments Details Value Author(s) References See Also Examples
Compute the projection index or its derivatives from the T and U statistics.
1 2 | PP3ix3FromTU(the.init, avec, bvec, cvec, maxrow, k, maxcol, n, text)
PP3ix3dvsFromTU(the.init, avec, bvec, cvec, maxrow, k, maxcol, n, text, type = "value")
|
the.init |
Initialization information, such as from |
avec |
First projection vector of length K |
bvec |
Second projection vector, of length K |
cvec |
Third projection vector, of length K |
maxrow |
Maximum number of variables |
k |
Actual number of variables (usually |
maxcol |
Maximum number of observations |
n |
Actual number of observations. (usually |
text |
Integer. If equal to one then information messages from the FORTRAN code are produced. If equal to zero, then they are not. |
type |
What type of information to return. If set to |
The T
and U
third- and fourth-order moment related
statistics are computed using PP3init
. The
projection index and its derivative are computed using these.
This function can return either statistic. If you just want the
index then you can supply the "value"
argument, but
it might be quicker to use PP3ix3FromTU
which is
called by the user-friendly PP3fastIX3
.
If type
is set to "value"
then a single value
of the projection index is returned. If type
is set to
"deriv"
then a vector, of length 3xK, with the derivative
with respect to avec
, bvec
and cvec
is
returned.
G. P. Nason
Friedman, J.H. and Tukey, J.W. (1974) A projection pursuit algorithm for exploratory data analysis. IEEE Trans. Comput., 23, 881-890.
Jones, M.C. and Sibson, R. (1987) What is projection pursuit? (with discussion) J. R. Statist. Soc. A, 150, 1-36.
Nason, G. P. (1995) Three-dimensional projection pursuit. J. R. Statist. Soc. C, 44, 411-430.
Nason, G. P. (2001) Robust projection indices. J. R. Statist. Soc. B, 63, 551-567.
PP3init
, PP3fastIX3
, PP3slowDF3
1 2 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 | #
# Not for direct user use, but here is an example
#
#
# Load flea beetle data
#
data(beetle)
#
# Initialize T and U tensors
#
b.init <- PP3init(t(beetle))
#
# Get number of cases and dimensions
#
b.n <- nrow(beetle)
b.k <- ncol(beetle)
fortran.messages <- 0
#
# Select arbitrary projection vectors
#
b.pva <- c(1, rep(0, b.k-1))
b.pvb <- c(0, 1, rep(0, b.k-2))
b.pvc <- c(0, 0, 1, rep(0, b.k-3))
#
# Now compute the projection index for this data for this direction
#
answer <- PP3ix3FromTU(the.init=b.init, avec=b.pva, bvec=b.pvb,
cvec=b.pvc, maxrow=b.k, k=b.k, maxcol=b.n, n=b.n,
text=fortran.messages)
#
# Print out answer
#
answer
# [1] 13.49793
#
# Now compute the projection index derivatives for this data for this
# direction
#
answer <- PP3ix3dvsFromTU(the.init=b.init, avec=b.pva, bvec=b.pvb,
cvec=b.pvc, maxrow=b.k, k=b.k, maxcol=b.n, n=b.n,
text=fortran.messages, type="deriv")
#
# Print out answer
#
answer
# [1] 0.000000e+00 0.000000e+00 0.000000e+00 -1.283695e-15 0.000000e+00
# [6] 0.000000e+00 0.000000e+00 -4.649059e-16 0.000000e+00 2.910680e+00
#[11] -4.941646e+00 -1.232917e+00 1.057721e-01 -4.608611e+00 -8.286708e-01
#[16] -1.602697e-01 1.724654e+00 -2.029220e+00
#
# The answer is a vector of length 3xb.k = 18. The first b.k=6 entries
# correspond to the derivative wrt b.pva, the next b.k=6 entries to
# b.pvb, and the last b.k=6 entries to b.pvc.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.