Team:Paris/Modeling/More f3 Algo
From 2008.igem.org
(Difference between revisions)
(→find_3 ( OmpR* )) |
|||
(3 intermediate revisions not shown) | |||
Line 16: | Line 16: | ||
== find_ƒ3 ( ''FliA'' ) == | == find_ƒ3 ( ''FliA'' ) == | ||
+ | <html><pre class="codeinput"> | ||
+ | <span class="keyword">function</span> optimal_parameters = find_f3_FliA(X_data, Y_data, initial_parameters) | ||
+ | <span class="comment">% gives the 'best parameters' involved in f3 with OmpR = 0 by least-square optimisation | ||
+ | </span><span class="comment">% -> USE IT AFTER find_f3_OmpR | ||
+ | </span> | ||
+ | <span class="comment">% X_data = vector of given values of ( [FliA]i ) (experimentally | ||
+ | </span><span class="comment">% controled) | ||
+ | </span><span class="comment">% Y_data = vector of experimentally measured values f3 corresponding of | ||
+ | </span><span class="comment">% the X_data | ||
+ | </span><span class="comment">% initial_parameters = values of the parameters proposed by the literature | ||
+ | </span><span class="comment">% or simply guessed | ||
+ | </span><span class="comment">% = [beta22, K6 -> (K6)/(coefOmp), n6] | ||
+ | </span> | ||
+ | <span class="keyword">global</span> beta17;<span class="comment"> % parameter GIVEN BY find_f3_OmpR | ||
+ | </span> | ||
+ | <span class="keyword">function</span> output = act_pFlhDC(parameters, X_data) | ||
+ | <span class="keyword">for</span> k = 1:length(X_data) | ||
+ | output(k) = beta17*(1 - hill( X_data(k), parameters(2), parameters(3))) ... | ||
+ | + parameters(1)*hill(X_data(k), parameters(2), parameters(3)); | ||
+ | <span class="keyword">end</span> | ||
+ | <span class="keyword">end</span> | ||
+ | |||
+ | options=optimset(<span class="string">'LevenbergMarquardt'</span>,<span class="string">'on'</span>,<span class="string">'TolX'</span>,1e-10,<span class="string">'MaxFunEvals'</span>,1e10,<span class="string">'TolFun'</span>,1e-10,<span class="string">'MaxIter'</span>,1e4); | ||
+ | <span class="comment">% options for the function lsqcurvefit | ||
+ | </span> | ||
+ | optimal_parameters = lsqcurvefit( @(parameters, X_data) act_pFlhDC(parameters, X_data), ... | ||
+ | initial_parameters, X_data, Y_data, options ); | ||
+ | <span class="comment">% search for the fittest parameters, between 1/10 and 10 times the initial | ||
+ | </span><span class="comment">% parameters | ||
+ | </span> | ||
+ | <span class="keyword">end</span> | ||
+ | </pre></html> | ||
+ | == find_ƒ3 ( ''OmpR<sup>*</sup>'' ) == | ||
- | == | + | <html><pre class="codeinput"> |
- | + | <span class="keyword">function</span> optimal_parameters = find_f3_OmpR(X_data, Y_data, initial_parameters) | |
- | + | <span class="comment">% gives the 'best parameters' involved in f3 with FliA = 0 by least-square optimisation | |
+ | </span><span class="comment">% -> USE IT BEFORE find_f3_FliA | ||
+ | </span> | ||
+ | <span class="comment">% X_data = vector of given values of ( [OmpR]i ) (experimentally | ||
+ | </span><span class="comment">% controled) | ||
+ | </span><span class="comment">% Y_data = vector of experimentally measured values f3 corresponding of | ||
+ | </span><span class="comment">% the X_data | ||
+ | </span><span class="comment">% initial_parameters = values of the parameters proposed by the literature | ||
+ | </span><span class="comment">% or simply guessed | ||
+ | </span><span class="comment">% = [beta17, K15 -> (K15)/(coefOmp), n15] | ||
+ | </span> | ||
+ | <span class="keyword">function</span> output = act_pFlhDC(parameters, X_data) | ||
+ | <span class="keyword">for</span> k = 1:length(X_data) | ||
+ | output(k) =(1 - hill( X_data(k), parameters(2), parameters(3) )) * parameters(1); | ||
+ | <span class="keyword">end</span> | ||
+ | <span class="keyword">end</span> | ||
+ | |||
+ | options=optimset(<span class="string">'LevenbergMarquardt'</span>,<span class="string">'on'</span>,<span class="string">'TolX'</span>,1e-10,<span class="string">'MaxFunEvals'</span>,1e10,<span class="string">'TolFun'</span>,1e-10,<span class="string">'MaxIter'</span>,1e4); | ||
+ | <span class="comment">% options for the function lsqcurvefit | ||
+ | </span> | ||
+ | optimal_parameters = lsqcurvefit( @(parameters, X_data) act_pFlhDC(parameters, X_data), ... | ||
+ | initial_parameters, X_data, Y_data, options ); | ||
+ | <span class="comment">% search for the fittest parameters, between 1/10 and 10 times the initial | ||
+ | </span><span class="comment">% parameters | ||
+ | </span> | ||
+ | <span class="keyword">end</span> | ||
+ | </pre></html> | ||
</div> | </div> |
Latest revision as of 03:45, 30 October 2008
find_3 ( FliA )
function optimal_parameters = find_f3_FliA(X_data, Y_data, initial_parameters) % gives the 'best parameters' involved in f3 with OmpR = 0 by least-square optimisation % -> USE IT AFTER find_f3_OmpR % X_data = vector of given values of ( [FliA]i ) (experimentally % controled) % Y_data = vector of experimentally measured values f3 corresponding of % the X_data % initial_parameters = values of the parameters proposed by the literature % or simply guessed % = [beta22, K6 -> (K6)/(coefOmp), n6] global beta17; % parameter GIVEN BY find_f3_OmpR function output = act_pFlhDC(parameters, X_data) for k = 1:length(X_data) output(k) = beta17*(1 - hill( X_data(k), parameters(2), parameters(3))) ... + parameters(1)*hill(X_data(k), parameters(2), parameters(3)); end end options=optimset('LevenbergMarquardt','on','TolX',1e-10,'MaxFunEvals',1e10,'TolFun',1e-10,'MaxIter',1e4); % options for the function lsqcurvefit optimal_parameters = lsqcurvefit( @(parameters, X_data) act_pFlhDC(parameters, X_data), ... initial_parameters, X_data, Y_data, options ); % search for the fittest parameters, between 1/10 and 10 times the initial % parameters end
find_3 ( OmpR* )
function optimal_parameters = find_f3_OmpR(X_data, Y_data, initial_parameters) % gives the 'best parameters' involved in f3 with FliA = 0 by least-square optimisation % -> USE IT BEFORE find_f3_FliA % X_data = vector of given values of ( [OmpR]i ) (experimentally % controled) % Y_data = vector of experimentally measured values f3 corresponding of % the X_data % initial_parameters = values of the parameters proposed by the literature % or simply guessed % = [beta17, K15 -> (K15)/(coefOmp), n15] function output = act_pFlhDC(parameters, X_data) for k = 1:length(X_data) output(k) =(1 - hill( X_data(k), parameters(2), parameters(3) )) * parameters(1); end end options=optimset('LevenbergMarquardt','on','TolX',1e-10,'MaxFunEvals',1e10,'TolFun',1e-10,'MaxIter',1e4); % options for the function lsqcurvefit optimal_parameters = lsqcurvefit( @(parameters, X_data) act_pFlhDC(parameters, X_data), ... initial_parameters, X_data, Y_data, options ); % search for the fittest parameters, between 1/10 and 10 times the initial % parameters end