function [oy] = sim_gmpe_fcc(igrnn,ix, varargin)
% function [ogrnn,oy] = sim_gmpe_fcc(igrnn,ix, varargin))
% Fahlman Cascade Correlation
% Symulation of the  FCC
%
% Inputs:
%   ix - input values excluding bias (table)
%   igrnn - the FCC
%
% Outputs
%   oy - estymated output of the GMPE
%
% (c) Jan Wiszniowki 2016.02.17

    N_cascades = length(igrnn) ;
    xM = size(ix,1) ;
    for i = 1:N_cascades
        w0 = igrnn(i).w ;
        b0 = igrnn(i).b.b ;
        if i ~= 1
            on = tanh(ix * w0) ;
        else
            on = ones(xM,1) ;
        end
        ix = [ix,on] ;
        oy = ix * b0 ;
    end        
end