Team:Paris/Modeling/

Estimation of the parameters


     function Popt=findparam



 function   Popt=findparam

  </o:p>

<p class=MsoPlainText>  </o:p>

<p class=MsoPlainText> <span lang=EN-GB style='mso-ansi-language: EN-GB'>clear , close all</o:p>

<p class=MsoPlainText>  </o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> %Parameters</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   Tmax=100; %Time of the simulation </o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   Npoints=40; %Number of points available. We assume for the tests that they are regularly distant.</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   x=1 :Tmax /Npoints:Tmax<span style='color:black'>; %Definition of the inducer vector.</o:p>

<p class=MsoPlainText>  </o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   % The following function provides a Hill function, given a X vector and</o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   %some parameter that characterizes it. </o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>function</b> y= Hill(x,K,Vmax,n)</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   l=length(x);</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   for i=1:l</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>       if K&lt;0 s(i)=K; else s(i)=x(i); end</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>       y(i)=(Vmax*(s(i)^n))/((x(i)^n)+(K^n));</o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   end </o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>end</b> <b style='mso-bidi-font-weight:normal'><o:p></o:p></b>

<p class=MsoPlainText> <o:p> </o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>% Then, we want to introduce some noise in the data obtained, in order to<o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>% simulate biological results.<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>function</b> y = NoisyHill(x,K,Vmax,n)<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   y=Hill(x ,K,Vmax,n );<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   for i=1:length(x)<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>      <span class=GramE>y( i)=random('normal',y(i),Vmax/20);<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   end <o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>end</b> <b style='mso-bidi-font-weight:normal'><o:p></o:p></b>

<p class=MsoPlainText> <o:p> </o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>% Finally, we create a 'noisy Hill' vector that will be considered as<o:p></o:p>

<p class=MsoPlainText> <span lang=EN-GB style='color:#339966; mso-ansi-language:EN-GB'>%biological data. <span lang=EN-GB style='color:#339966;mso-ansi-language:EN-GB'><o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>function</b> set = genset<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   K=30;<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   Vmax=2;<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   n=3;<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   set= NoisyHill([1:Tmax/Npoints:Tmax],K,Vmax,n);<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>end</b> <b style='mso-bidi-font-weight:normal'><o:p></o:p></b>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   set= genset;<o:p></o:p>

<p class=MsoPlainText> <o:p> </o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   % The

heart of the problem is to minimize the distance between a<o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   %deterministic Hill function and the noisy one obtained. 'Toopt' is<o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   %just the criteria to minimize. <o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   <b style='mso-bidi-font-weight: normal'>function</b> y = toopt(x,P)<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   y=Hill(x ,10 *P(1),P(2),P(3))-set;<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   end <o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>   <o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>% These lines use a Matlab function to carry out the optimization process<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   options= optimset('LevenbergMarquardt','on','TolX',1e-10,'MaxFunEvals',1e7,'TolFun',1e-5);<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'>   Popt=<b style='mso-bidi-font-weight:normal'>lsqnonlin</b>(@(P)toopt(x,P),[0.1,1,1],[0,0,0],[5,10,10],options);<o:p></o:p>

<p class=MsoPlainText style='tab-stops:126.6pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'>   Popt=<span class=GramE>Popt;   <o:p></o:p>

<p class=MsoPlainText style='tab-stops:126.6pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>%In order to see the results, we plot both the noisy curve and the<o:p></o:p>

<p class=MsoPlainText><span lang=EN-GB style='color:#339966;mso-ansi-language: EN-GB'>%estimated one.<o:p></o:p>

<p class=MsoPlainText> <span lang=EN-GB style='mso-ansi-language: EN-GB'>plot( set)<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> hold on<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> plot( Hill(x,10*Popt(1),Popt(2),Popt(3) ),'r');<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> legend( 'Experimental Hill function','Estimation of the experimental hill function');<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> gtext( 'NPoints=40, Standard Deviation=1/10');

<p class=MsoPlainText> <span lang=EN-GB style='mso-ansi-language:EN-GB'>xlabel( <span lang=EN-GB style='mso-ansi-language:EN-GB'>'Concentration of X');<o:p></o:p>

<p class=MsoPlainText> <span style='mso-spacerun:yes'> ylabel( 'Rate of Y production');<o:p></o:p>

<p class=MsoPlainText> end

<p class=MsoPlainText>


 * }<br style="clear:both" />