Home > src > geckomat > kcat_sensitivity_analysis > Bayesian > updateprior.m

updateprior

PURPOSE ^

updateprior

SYNOPSIS ^

function [a,b] = updateprior(x)

DESCRIPTION ^

 updateprior
   Calculates a new distribution from the selected kcat values

 Input:
   x               kcats
 Output:
   a               Mean
   b               Std dev

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [a,b] = updateprior(x)
0002 % updateprior
0003 %   Calculates a new distribution from the selected kcat values
0004 %
0005 % Input:
0006 %   x               kcats
0007 % Output:
0008 %   a               Mean
0009 %   b               Std dev
0010 
0011 x = x{:};
0012 x(x == 0) = []; %remove zeros - they cannot be handled in the log transform below
0013 if length(x) == 0
0014     %we don't have much choice in the two first cases - just set sigma to 1 - same as in the initial prior
0015     a = 0;
0016     b = 1;
0017 elseif length(x) == 1
0018     a = x;
0019     b = 1;
0020 else
0021     pd = fitdist(log10(x./3600),'Normal');
0022     a = 10^(pd.mu)*3600;
0023     b = pd.sigma;
0024 end
0025 
0026 end

Generated by m2html © 2005