The EGLD-ICA package is Copyright (c) Helsinki University of Technology,
Signal Processing Laboratory,
Jan Eriksson, Juha Karvanen, and Visa Koivunen.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Version: 1.1
Version date: September 25, 2000

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description
===========

This package provides the Matlab (5.x) functions needed for the use of the
EGLD-ICA algorithm as described in

  Eriksson, J., Karvanen, J., and Koivunen, V.:
  "Source Distribution Adaptive Maximum Likelihood Estimation of ICA Model", 
  Proceedings of Second International Workshop on
  Independent Component Analysis and Blind Signal Separation,
  Helsinki 2000, pp. 227--232

The algorithm is proposed to solve  the standard noiseless linear 
ICA problem, i.e. the ICA model is Y=AS, where the number of sources
s_i is equal to the number of observations y_i.

If you use this program for your work, please cite the above paper.

Additionally this package also provides some functions for using the
Extended Generalized Lambda Distribution (EGLD) family of distributions
as described in

  Karian, Z.A., Dudewicz, E.J., and McDonald, P.:  
  "The Extended Generalized Lambda
  Distribution System for Fitting Distributions to Data: 
  History, Completion of Theory, Tables, Applications, the
  `Final Word' on Moment Fits",
  Communications in Statistics: Simulation and Computation,
  1996, Vol. 25, No. 3, pp. 611--642  

Notice that the functions gbd_cdf.m, gbd_inv.m, and gbd_rnd.m 
use the Statistics Toolbox supplement to Matlab. However,
these functions are not used by EGLD-ICA functions, so you
can use EGLD-ICA algorithm without the Statistics Toolbox.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Installation: Just put all files to a directory along Matlab's search path.
============

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Quick use: Type egld_ica_demo for a demonstration.
=========

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Use: 
===

1) EGLD-ICA algorithm
~~~~~~~~~~~~~~~~~~~~~

Suppose you have a ICA mixture in the matrix `mixedsig', where
the different rows correspond to the different observations. Then

estimatedsig=egld_ica(mixedsig)

gives the estimated independent components as the rows of the
matrix `estimatedsig'. The estimated mixing matrix A and
estimated separation matrix W are obtained as

[estimatedsig,A,W]=egld_ica(mixedsig) 

There are also some optional parameters you can change:
   'epsilon'           Convergence constant
   'maxNumIterations'  Maximum number of iterations
   'type'              Choose the model used besides the GLD.
                       Possible values:
                       'egld'    (use both GLD and GBD) 
                       'gld'     (use GLD always)
                       'gldtanh' (use tanh when GLD not applicable)
   'borderBase'
   'borderSlope'        The minimum kurtosis value for switching to 
                        the GBD (tanh) area. Thus the algorithm
                        uses GLD for values
                        kurtosis>borderBase+borderSlope*skewness^2, 
                        and GBD (tanh) for the other values.     
                   
The default values for the parameters are epsilon=0.0001,
maxNumIterations=200, type='egld', borderBase=2.2, and borderSlope=1.75.
The default borderSlope value comes from the relation between 
the theoretical minimum kurtosis and the corresponding skewness. 
                       
Example: 
  ICs=egld_ica(mixedsig,'epsilon',0.00005,'maxNumIterations',50,'type','gld');

2) Use of the other EGLD functions and the list of files in the package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

!!!!! Before using any of the EGLD functions (once in your    !!!!!
!!!!! Matlab session), you should call the program egld_use.  !!!!!

Files in EGLD_ICA.zip package are given below in the list. 
The syntax for calls, dependences from non-standard Matlab functions,
and examples are given for functions provided by the package.

contents.m
  A brief description of all the files in the package.

egld_ica_demo.m
  A demonstration of the EGLD-ICA algorithm in work.

egld_ica.m
  The main file for the EGLD-ICA algorithm. 
  Look above for instructions how to call this function.

  Syntax:      [ICs, A, W]=egld_ica(mixedsig, 
                       [s1, v1, s2, v2, s3, v3, s4, v4, s5, v5]);

  Example:     sig_len=5000;
               lambda=gld_momentfit(-0.5,3); 
               signals123=gld_rnd(lambda,[3 sig_len]);
               signal4=randn(1,sig_len);
               B=randn(4);
               mixedsig=B*[signals123; signal4];
               [ICs,A,W]=egld_ica(mixedsig,'epsilon',0.00005);

  Dependences: fasticaegld, 
               gbd_momentfit, gbd_score,
               gld_momentfit, gld_score, gld_cdf, gld_inv

egld_use.m
  The script provides all the global initialization needed for the use of the
  EGLD functions. Run this script before using the other functions!
              
fasticaegld.m
  Strip down of Hyvrinen's FastICA algorithm. This is the core function
  used by egld_ica. Use egld_ica to call this function.

  Syntax:      [ICs, A, W]=fasticaegld(mixedsig,sub_alg,epsilon,...
			     maxNumIterations,borderBase,borderSlope);

  Dependences: gbd_momentfit, gbd_score,
               gld_momentfit, gld_score, gld_cdf, gld_inv
             
gbd_cdf.m
  Provides the gbd_cdf function, which calculates the values of 
  the cumulative distribution function of a distribution from 
  the Generalized Beta  Distribution (GBD).  Statistics Toolbox is 
  needed for this function. The function is not used by EGLD-ICA.

  Syntax:      gld_cdf(x,beta)

  Dependences: betacdf (in Statistics Toolbox)

  Example:     x=0:0.01:1; 
               beta_uniform=[0,1,0,0]; 
               plot(x,gbd_cdf(x,beta_uniform));

gbd_inv.m
  Provides the gbd_inv function, which calculates the inverse 
  function of the cumulative distribution function of 
  a distribution from the Generalized Beta Distribution (GBD).
  The function is not used by EGLD-ICA. 
  Statistics Toolbox is needed for this function.

  Syntax:      gbd_inv(cp,beta)

  Dependences: betainv (in Statistics Toolbox)

  Example:     cp=0:0.001:1;
               beta_uniform=[0,1,0,0];
               plot(gbd_inv(cp,beta_uniform),cp);

gbd_momentfit.m   
  Provides the gbd_momentfit function, which estimates the parameters of 
  a distribution from the Generalized Beta Distribution (GBD) using 
  the first four sample moments. Alternatively, the sample minimum and 
  maximum can be used instead of the sample mean and variance.
  
  Syntax:      gbd_momentfit(alpha3,alpha4,samplemin,samplemax,samplen)
               gbd_momentfit(alpha3,alpha4,alpha1,alpha2) 

  Dependences: -

  Examples:    beta=gbd_momentfit(0.254,2.526,57,580)
               beta=gbd_momentfit(0.254,2.526,-0.68,144,1000)

gbd_pdf.m    
  Provides the gbd_pdf function, which calculates the values of the 
  probability density function of a distribution from the Generalized 
  Beta Distribution (GBD). The function is not used by EGLD-ICA.

  Syntax:      gbd_pdf(x,beta)

  Dependences: -

  Example:     x=0:0.1:140;
               beta=gbd_momentfit(0.254,2.526,57,580);
               plot(x,gbd_pdf(x,beta));

gbd_rnd.m   
  Provides the gbd_rnd function, which returns a size N matrix of random 
  numbers drawn from a distribution from the Generalized Beta 
  Distribution (GBD). The function is not used by EGLD-ICA. 
  Statistics Toolbox is needed for this function.
  
  Syntax:      gbd_rnd(beta[,N])

  Dependences: betarnd (in Statistics Toolbox)

  Example:     beta=gbd_momentfit(0.254,2.526,57,580);
               gbd_rnd(beta,[1 4])
               gbd_rnd(beta)
               gbd_rnd(beta,4)

gbd_score.m 	      
  Provides the gbd_score function, which calculates values of the score 
  function and its derivative of a distribution from the Generalized 
  Beta Distribution (GBD).

  Syntax:      [phi,phi_prime]=gbd_score(x,beta)

  Dependences: -

  Example:     x=0:0.1:140;
               beta=gbd_momentfit(0.254,2.526,57,580);
               [phi,phi2]=gbd_score(x,beta);
               plot(x,phi);

gld_cdf.m
  Provides the gld_cdf function, which calculates the values of 
  the cumulative distribution function of a distribution from 
  the Generalized Lambda Distribution (GLD).

  Syntax:      gld_cdf(x,lambda)

  Dependences: gld_inv

  Example:     x=-3:0.01:3;          
               lambda_normal=gld_momentfit(0,3);
               plot(x,gld_cdf(x,lambda_normal));
            
gld_inv.m
  Provides the gld_inv function, which calculates the inverse 
  function of the cumulative distribution function of a distribution from
  the Generalized Lambda Distribution (GLD).

  Syntax:      gld_inv(cp,lambda)

  Dependences: -

  Example:     cp=0:0.001:1;
               lambda_normal=gld_momentfit(0,3);
               plot(gld_inv(cp,lambda_normal),cp);

gld_momentfit.m 
  Provides the gld_momentfit function, which estimates the parameters of 
  a distribution from the Generalized Lambda Distribution (GLD) using 
  the first four moments. 

  Syntax:      gld_momentfit(alpha3,alpha4[,alpha1,alpha2])

  Dependences: -

  Examples:    lambda_normal=gld_momentfit(0,3);
               lambda_normal=gld_momentfit(0,3,0,1); 

GLD_moment_table.mat 
  This file contains the table values for the Generalized Lambda Distribution 
  (GLD). This table is needed in estimation of the GLD parameters through the 
  method of moments (gld_momentfit function). You should load the table via 
  the command egld_use. The table is adapted from
    E.J. Dudewicz, Z.A. Karian: "The Extended Generalized Lambda
    Distribution (EGLD) System for Fitting Distributions to Data with 
    Moments, II: Tables", American J. of Math. and Management
    Sciences, 1996, Vol. 16, NOS. 3& 4, pp. 271--332 

gld_pdf.m  
  Provides the gld_pdf function, which calculates the values of the 
  probability density function of a distribution from the Generalized 
  Lambda Distribution (GLD). The function is not used by EGLD-ICA.

  Syntax:      gld_pdf(x,lambda)

  Dependences: gld_cdf, gld_inv

  Example:     x=-3:0.01:3;
               lambda_normal=gld_momentfit(0,3);
               plot(x,gld_pdf(x,lambda_normal));  	    

gld_rnd.m
  Provides the gld_rnd function, which returns a size N matrix of random 
  numbers chosen drawn from a distribution from the Generalized Lambda 
  Distribution (GLD). The function is not used by EGLD-ICA.
  
  Syntax:      gld_rnd(beta[,N])

  Dependences: gld_inv

  Example:     lambda_normal=gld_momentfit(0,3);
               gld_rnd(lambda_normal,[1 4])
               gld_rnd(lambda_normal)
               gld_rnd(lambda_normal,4)
 
gld_score.m
  Provides the gld_score function, which calculates values of the score 
  function and its derivative of a distribution from the Generalized 
  Lambda Distribution (GLD).

  Syntax:      [phi,phi_prime]=gld_score(x,lambda)

  Dependences: gld_cdf, gld_inv

  Example:     x=-3:0.01:3;
               lambda_normal=gld_momentfit(0,3);
               [phi,phi2]=gld_score(x,lambda_normal);
               plot(x,phi);

gpl.txt
  The GNU General Public License 

readme.txt 
  This file.

% The end of readme.txt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



