uv: Conjugate complement of a space

View source: R/ell.R

uvR Documentation

Conjugate complement of a space

Description

Conjugate complement of a space

Usage

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

##---- 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)
    }

gmonette/p3d documentation built on Nov. 16, 2023, 11:31 p.m.