% NEWTC new time-course neural network model % [net,P,T] = newtc(p,t,D,S,TF) % p : input array % t : target array (time-course data) % D : layer delays % S : layer sizes % TF : transfer functions % net : feedforward network % P : sequential inputs for net % T : sequential outputs for net %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [net,P,T] = newtc(p,t,D,S,TF) l = size(p,1); % number of inputs n = size(p,2); % number of observations q = size(t,1); % number of time points d = length(D); % number of delay lines % Create extended input array P = zeros(l+d,n*q); for i = 1:n % duplicate inputs for all time points ps = p(:,i)*ones(1,q); P(1:l,(1:q)+((i-1)*q)) = ps; end % Create additional inputs that represent time-delays P((l+1):(l+d),:) = repmat(reshape(t,1,n*q),d,1); for i = 1:d P(i+l,:) = circshift(P(i+l,:),[0 D(i)]); for j = 0:(n-1) P(i+l,(j*q+1):(j*q+D(i))) = 0; end end % Create feedforward network net = newff(minmax(P),S,TF); net.biasConnect = zeros(size(net.biasConnect)); T = reshape(t,1,n*q);