Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

solutionSpace

returns the solution space (basis and translation vector) for an equation system


Description

returns the solution space (basis and translation vector) for an equation system

Usage

solutionSpace(A, b)

Arguments

A

numeric matrix

b

numeric vector

Details

For a linear equationsystem, Ax = b, the solution space then is

x = A'b + (I - A' A)

where A' is the Moore-Penrose pseudoinverse of A. The QR decomposition of I - A'A determines the dimension of and basis of the solution space.

Value

basis

matrix containing the basis of the solution space

translate

translation vector

Examples

A <- matrix(rnorm(21),3,7)
b <- c(1,2,3)
subspace <- solutionSpace(A,b)
dims <- ncol(subspace$basis) # we now have a 4D solution space
## now pick any vector from this space. E.g
y <- 1:dims
solution <- subspace$basis%*%y+subspace$translate # this is one solution for the equation above
A%*%solution ## pretty close

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.