function obj = rica(X,Q,varargin)
%rica - Create a reconstruction ICA (RICA) object.
%   OBJ = rica(X,Q) takes a N-by-P predictor matrix X and an integer Q and
%   applies reconstruction ICA (RICA) to learn a P-by-Q matrix of
%   transformation weights. N is the number of observations, P is the
%   number of predictors and Q is the desired number of new features. OBJ
%   is an object of type ReconstructionICA.
%
%   OBJ = rica(TBL,Q) is an alternative syntax that accepts a table TBL.
%   All variables in TBL must be numeric variables.
%
%   o The learned transformation weights can be accessed using the
%   TransformWeights property of OBJ.
%
%   o A N-by-P matrix X of original features can be transformed into a
%   N-by-Q matrix of new features Z via the TRANSFORM method of OBJ.
%
%   OBJ = rica(X,Q,varargin) also accepts the following additional
%   name/value pairs to control the fitting:
% 
%       'IterationLimit'  - A positive integer specifying the maximum 
%                           number of iterations. Default is 1000.
%       'VerbosityLevel'  - A non-negative integer specifying the verbosity
%                           level as follows:
%                           * 0   - no convergence summary is displayed.
%                           * >=1 - convergence summary is displayed on
%                                   screen.
%                           Default is 0.
%       'Lambda'          - A non-negative real scalar specifying the
%                           penalty coefficient for the reconstruction term
%                           in the objective function. Default is 1.
%       'Standardize'       Logical scalar. If true, standardize predictors 
%                           by centering and dividing columns by their 
%                           standard deviations. Default is false.
%       'ContrastFcn'       A character vector specifying the contrast
%                           function for RICA. Choices are 'logcosh', 'exp'
%                           or 'sqrt'. Default is 'logcosh'.
%       'InitialTransformWeights'
%                         - A P-by-Q matrix of transformation weights to 
%                           initialize the optimization for transformation
%                           weights. Default is [] indicating that initial
%                           transformation weights should be chosen
%                           randomly.
%       'NonGaussianityIndicator'
%                         - A length Q vector sgn with elements +1 or -1
%                           specifying the type of non-Gaussianity of the
%                           sources. If sgn(k) = +1 then k-th source is
%                           assumed to be super-Gaussian (sharp peak at
%                           zero). If sgn(k) = -1 then k-th source is
%                           assumed to be sub-Gaussian. Default is
%                           ones(Q,1).
%       'GradientTolerance' 
%                         - A positive real scalar specifying the relative
%                           convergence tolerance on the norm of the
%                           objective function gradient. Default is 1e-6.
%       'StepTolerance'   - A positive real scalar specifying the absolute
%                           convergence tolerance on the step size. Default
%                           is 1e-6.
%
%   See also ReconstructionICA, sparsefilt.

%   Copyright 2016-2019 The MathWorks, Inc.

    if nargin > 2
        [varargin{:}] = convertStringsToChars(varargin{:});
    end
    
    obj = ReconstructionICA(X,Q,varargin{:});
end