FCA.FCA
— ModuleModule providing the free componant analysis (FCA) algorithm.
FCA.ent_sum
— Methodent_sum(Z)
Calculate the negative um of negentropy of rows of Z
FCA.err_pd
— Methoderr_pd(Ie)
Calculate the error (up to permuataion and rescaling) between Ie and identity matrix:
where $P$ runs over all permuataion matrices and $D$ runs over all diagonal non-singular matrices. $||~||_F$ denotes the Frobeneous norm.
Arguments
Ie
: the input matrix, supposed to be close to identity matrix.
Outputs
err
: the error betweenIe
and identity matrix defined as above.
FCA.free_ent
— Methodfree_ent(X; mat = "her")
This function return the free entropy of a matrix X
Arguments
X
: a matrix, Hermitian or rectangularmat
: the type of X, valid options are "her" and "rec"
Outputs
chi
: a scalr, it is the free entropy of X
FCA.free_whiten
— Methodfree_whiten(Z; mat = "her")
This function whitens input array of matrices in the free probability sense
Arguments
Z
: an array of matrices of mat and of the same dimensionsmat
: the type of Z[i], valid options are "her" and "rec"
Outputs
Y
: an array of centered matrices, whitened in the free probability sense, that is, Tr(Y[i]*Y[j]')/size(Y[1],1) = (i == j)U
: a matrix of size s-by-s, where s = size(Z, 1)Σ
: a matrix of size s-by-s,
FCA.freecf
— Methodfreecf(Z; mat="her", obj="kurt", opt="orth")
Apply free component analysis to Z, return estimated mixing matrix and free components
Arguments
Z
: an array of matrices of mat and of the same dimensionsmat
: the type of Z[i], valid options are "her" and "rec"obj
: the type of loss function, valid options are "kurt" and "ent"opt
: string, type of optimization, valid option: "orth", "sphe"
Outputs
Aest
: a matrix of sizes
-by-s
, wheres
= size(Z, 1)Xest
: an array of "free" matrices, such thatZ = Aest*Xest
FCA.grad_ent_sum
— Methodgradentsum(W, Z)
This function calcualtes the gradient of ent_sum(W'*Z) w.r.t W
Arguments
W
: a matrix such that size(W, 1) = size(Z, 1)Z
: an array of vectors of the same length, regarded as the realizations of mixed independent signals
Outputs
grad
: the gradient of ent_sum(W'*Z) w.r.t W
FCA.grad_neg_abs_sum_free_kurt
— Methodgrad_neg_abs_sum_free_kurt(W, Y)
This function calcualtes the gradient of negabssumfreekurt(W'*Y) w.r.t W
Arguments
W
: a matrix such that size(W
, 1) = size(Y
, 1)Y
: an array of matrix of same type and same dimension
Outputs
grad
: the gradient of negabssumfreekurt(W'*Y) w.r.t W
FCA.grad_neg_abs_sum_kurt
— Methodgradnegabssumkurt(W, Z)
This function calcualtes the gradient of negabssum_kurt(W'*Z) w.r.t W
Arguments
W
: a matrix such that size(W, 1) = size(Z, 1)Z
: an array of vectors of the same length, regarded as the realizations of mixed independent signals
Outputs
grad
: the gradient of negabssum_kurt(W'*Z) w.r.t W
FCA.grad_sum_free_ent
— Methodgrad_sum_free_ent(W, Z; mat = "her")
This function calcualtes the gradient of sumfreeent(W'*Y) w.r.t W
Arguments
W
: a matrix such that size(W, 1) = size(Y, 1)Y
: an array of matrix of same type and same dimension
Outputs
grad
: the gradient of sumfreeent(W'*Y) w.r.t W
FCA.icf
— Methodicf(Z; opt = "orth")
Apply independent component analysis to Z, return estimated mixing matrix and independent components
Arguments
Z
: an array of vectors of the same length, represent the realizations of mixed independent signalsobj
: the type of loss function, valid options are "kurt" and "ent"opt
: string, type of optimization, valid option: "orth", "sphe". The "sphe" is only designed for "kurt" loss function
Outputs
Aest
: estimated mixing matrix of sizes
-by-s
, wheres
= size(Z,1)Xest
: estimated independent componentXest = pinv(Aest)*Z
FCA.kurt
— Methodkurt(z)
This function returns the kurtosis of z
Arguments
z
: an vector regarded as independent realizations of a random variables
Outputs
k
: a scalar, kurtosis of z
FCA.mat_center
— Methodmat_center(X; mat = "her")
This function centers input. If X is a Hermitian matrix, then $Xcen = X - Tr(X)/N*I$. If X is a rectangular matrix, then
Xcen = X - X*ones(M,1)*ones(1,M)/M
`.
Arguments
X
: a Hermitian or rectangular matrixmat
: the type ofX
, valid options are "her" and "rec"
Outputs:
Xc
: centered version ofX
FCA.mat_embed
— Methodmat_embed(X, dim; zero_pos = -1, tpin = "her", tpout = "her")
This function embeds X into new dimensions dim, with the Cartesian order of the entries are preserved. Fill in zeros at zero_pos if necessary.
Arguments
X
: a Hermitian or rectangular matricedim
: target dimension, array-like [Nnew,Mnew]zero_pos
: an array of user specify Cartesian position for zeros. if it is -1, then use randomly generated position.tpin
: the type of input matrix, valid options are "her" and "rec".tpout
: the type of ouput matrix, valid options are "her" and "rec"
Outputs
Xnew
: a matrix of dimension dim and the type tpin. The entries Xnew are from X, with possible extra zeros at zero_pos,
FCA.neg_abs_sum_free_kurt
— Methodneg_abs_sum_free_kurt(Z)
This function calculates the sum of negative absolute value of free kurtosis of components of Z
FCA.neg_abs_sum_kurt
— Methodneg_abs_sum_kurt(Z)
Calculate the sum of negative absolute value of kurtosis of rows of Z
FCA.negent
— Methodnegent(z)
This function returns the negentropy of z
Arguments
z
: an vector regarded as independent realizations of a random variables
Outputs
k
: a scalar, negentropy of z
FCA.sum_free_ent
— Methodsum_free_ent(Z; mat = "her")
This function calculates the sum of free entropy of components of Z
FCA.κ₄
— Methodκ₄(X)
This function return the free kurtosis of a matrix X
Arguments
X
: a matrix, Hermitian or rectangular
Outputs
fk
: a scalar, the free kurtosis of X
FCA.OptOrtho
— MethodOptOrtho(loss, grad, s)
This function returns the opimizer of loss, whose feasible set is O(s), using the GradientDescent method from Manifold optimization package Optim
Arguments
loss
: loss function whose input is a orthogonal matrixgrad
: Euclidean gradient function of loss function w.r.t to the orthogonal matrixs
: The feasible set is O(s)opt_config
: configuration passed to Optim
Outputs:
Xopt
: orthogonal matrix optmize loss function
FCA.OptSphere
— MethodOptOrtho(loss, grad, s)
This function returns the opimizer of loss, whose feasible set is S(s - 1), using the GradientDescent method from Manifold optimization package Optim
Arguments
loss
: loss function whose input is a orthogonal matrixgrad
: Euclidean gradient function of loss function w.r.t to the orthogonal matrixs
: The feasible set is S(s-1)opt_config
: configuration passed to Optim
Outputs:
Xopt
: orthogonal matrix optmize loss function