ITE / code / IPA / demos / demo_AR_IPA.m

%function [] = demo_AR_IPA()
%AR-IPA (AutoRegressive Independent Process Analysis) illustration.
%Model (AR-IPA):
%   F[z]s = e, F[z]=I-F_1*z^1-...-F_L*z^L, F[z]:stable, e:ISA source (see 'demo_ISA.m'),
%       x = As, A:invertible,
%Task: x -> A (or W=A^{-1}),s,F[z],e.
%Copyright (C) 2012 Zoltan Szabo ("", "szzoli (at) cs (dot) elte (dot) hu")
%This file is part of the ITE (Information Theoretical Estimators) Matlab/Octave toolbox.
%ITE 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 3 of the License, or (at your option) any later version.
%This software 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 ITE. If not, see <>.

%clear start:
    clear all; close all;

        %driving noise(e):
            data_type = 'Aw';%see 'sample_subspaces.m'
            num_of_comps = 3;%number of components/subspaces in sampling
        %hidden source(s):
            num_of_samples = 5*1000;%number of samples    
            L = 2; %AR order 
            F_lambda = 0.7; %AR stability parameter, 0<F_lambda<1, see 'generate_AR_polynomial.m'
            AR.L = L;%AR order; can be vector, too; in that case the 'best' AR order is chosen according to SBC, see 'estimate_AR.m'.
            AR.method = 'stepwiseLS';%AR estimation method, see 'estimate_AR.m'
            unknown_dimensions = 0;%0: '{d_m}_{m=1}^M: known'; 1: 'M is known'
            %ICA solver (see 'estimate_ICA.m'):            
                ICA.opt_type = 'fastICA';
            %ISA solver (clustering of the ICA elements):
                ISA.cost_type = 'sumH'; %'I','sumH', 'sum-I','Irecursive', 'Ipairwise', 'Ipairwise1d'
                ISA.cost_name = 'Renyi_kNN_k'; %example: ISA.cost_type = 'sumH', ISA.cost_name = 'Renyi_kNN_1tok' means that we use an entropy sum ISA formulation ('sumH'), where the entropies are Renyi entropies estimated via kNN methods ('Renyi_kNN_1tok').
                ISA.opt_type = 'greedy';%optimization type: 'greedy', 'CE', 'exhaustive', 'NCut', 'SP1', 'SP2', 'SP3'
                %Many combinations are allowed for ISA.cost_type, ISA.cost_name and ISA.opt_type, see 'clustering_UD0.m', 'clustering_UD1.m'
%data generation (x,A,s,e,F,de):
    [x,A,s,e,Fs,de,Fx] = generate_AR_IPA(data_type,num_of_comps,num_of_samples,L,F_lambda);
%estimation (s_hat,e_hat,W_hat,de_hat,Fx_hat,Fs_hat):
    [s_hat,e_hat,W_hat,de_hat,Fx_hat,Fs_hat] = estimate_AR_IPA(x,AR,ICA,ISA,unknown_dimensions,de);
    %global matrix(G):
        G = W_hat * A; %G * s = s_hat; G2 = s_hat/s;
        hinton_diagram(G,'global matrix (G=WA)');%ideally: block-scaling matrix
    %performance of G:
        Amari_index = Amari_index_ISA(G,de,'subspace-dim-proportional',2),
    h = plot_subspaces(e_hat,data_type,'estimated subspaces (\hat{e}^m), m=1,...,M');
        %Fx,Fx_hat, %ideally: Fx = Fx_hat    
        %Fs_hat, Fs_hat_temp = basis_transformation_AR(Fs,G,inv(G)), %ideally: these two matrices are equal
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.