uv: Conjugate complement of a space

Description Usage Arguments Details Value Author(s) Examples

View source: R/ell.R

Description

Conjugate complement of a space

Usage

1
2
3
4
5
uv(object, ...)
## S3 method for class 'ell'
uv(object, u, radius = 1, ...)
## Default S3 method:
uv(object, u, radius = 1, ...)

Arguments

object

An ell object or the shape matrix for a multivariate sample

u

A direction vector

radius

Radius

...

Other arguments

Details

None yet

Value

A list with elements

u

A unit vector in the direction 'dir'

v

Conjugate direction

Author(s)

Georges Monette

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function( shape, u , radius = 1) {
       # returns 'unit' u and conjugate v
       ConjComp <- function( X , Z = diag( nrow(X)) , ip = diag( nrow(X)), tol = 1e-07 ) {

                     # ConjComp returns a basis for the conjugate complement of the
                     # conjugate projection of X into span(Z) with respect to inner product with
                     # matrix ip.
                     # Note: Z is assumed to be of full column rank but not necessarily X.
                     xq <- qr(t(Z) %*% ip %*% X, tol = tol)
                     if ( xq$rank == 0 ) return( Z )
                     a <- qr.Q( xq, complete = T ) [ ,-(1:xq$rank)]
                     Z %*% a
            }

            u <- u / sqrt( sum( u*solve(shape,u)))   # 'unit' vector in direction of dir
            v <- c(ConjComp( u, diag(2) , solve(shape)))  # conjugate
            v <- v / sqrt( sum( v * solve( shape, v)))
       list(u = radius * u, v= radius * v)
    }

p3d documentation built on May 2, 2019, 5:25 p.m.