function calccoreg(varargin)
% calculates shared gene function using a hierarchical model for
% parameter prior and for the prior over model indicators.
%
% (C) P. Sykacek, 2006 <peter@sykacek.net>

if nargin==0
    error('No files as arguments specified, aborting.');
end
fnames={};
resfnams={};
folds=varargin{1};
pricnts=varargin{2};

for na=3:nargin
    if mod (na, 2)==0
        resfnams=[resfnams, varargin(na)];
    else
        fnames=[fnames, varargin(na)];
    end
end
disp([fnames{:}]);
disp([resfnams{:}]);
nkernels='0';
basismdl='l';
basisprec='0';
g=sprintf('%15.14f', 10^-2) 
h=sprintf('%15.14f', 10^0)
gamma=sprintf('%f', 3/pi^2);
Pthrs='0.8';
% use intercept only model as reference...
refsubsno='NA';
acceps='0.001';
itermax='200';
dosyscycle='0';

nsim=length(resfnams);
if nsim ~= length(fnames)
    error('Number of output files is not the same as the number of input definitions. Aborting');
end
for n=1:nsim
     evalvbprb(fnames{n}, resfnams{n}, nkernels, basismdl, basisprec,...
         g, h, gamma, folds, Pthrs, refsubsno, itermax, acceps, pricnts,...
         dosyscycle);
end