<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000">
<TITLE>string identifier error in ADMB-RE</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">Hi</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">ve</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> been working on adding random effects to a model that I developed in ADMB.</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">In ADMB-RE, I frequently (but not always) get the error message</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">:</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Trebuchet MS">‘Error in string identifer in list value should be UZ it appears</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Trebuchet MS">to be      ...’</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Trebuchet MS">during the Newton Raphson 2 phase.</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">So far, I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">ve failed to identify the</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">cause</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> of the error</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">, and would really appreciate some suggestions</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">.</FONT></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">The full model is</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">a</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">hidden Markov model (designed to partition animal movement tracks</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">into movement mode</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">s), solved with a forwards-backwards algorithm.</FONT></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">I started with a relatively simple version of the model</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">(</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">forwards only,</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">12 estimated parameters, 6 random effects, standard deviation on random effects fixed</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">) and a simulated dataset</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">. I can run this</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">version</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> successfully on some datasets</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">,</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> but</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">the error message occurs with others</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">. In general, more complex versions of the model</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">(e.g. 16 estimated parameters)</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">are more likely to produce the error,</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> but occasionally the more complex model runs to completion while the simpler version fails.</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">Models without the</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">‘</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">if</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">statement</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> also</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">tend to</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">fail at the same point with the same error message.</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">(A</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">ll datasets are simulated according to the same parameters</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">. S</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">ome</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> have 8 trips with 1,000 observations each, others 32 trips with 1,000 observations each</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> The larger datasets are more likely to fail.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">)</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">Sometimes</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> a</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">coding</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">change appear</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">s</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> to</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">resolve the problem, but it</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">inevitably</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">returns</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> as I free up more parameters</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">ve pasted</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">the</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">complete</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">code below.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> This version works on some datasets but not on others.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">m</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">fairly</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">new to ADMB, so I</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">’</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">m sure there are many ways in which the code could be tightened up or made more efficient</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">, but resolving</FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">the string identifier</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"> error seems to be key.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> <FONT COLOR="#17365D" FACE="Trebuchet MS">If there is any additional information that would be useful, please let me know.</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">With many thanks in advance for your help.</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS">Charlotte Boyd</FONT></SPAN><SPAN LANG="en-us"><FONT COLOR="#17365D" FACE="Trebuchet MS"></FONT></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"><FONT COLOR="#008080" FACE="Trebuchet MS">School of Aquatic and Fishery Sciences</FONT></SPAN></I></P>

<P DIR=LTR><I><SPAN LANG="en-us"><FONT COLOR="#008080" FACE="Trebuchet MS">University of Washington</FONT></SPAN></I></P>

<P DIR=LTR><I><SPAN LANG="en-us"><FONT COLOR="#008080" FACE="Trebuchet MS">1122 NE Boat St, Rm 116</FONT></SPAN></I></P>

<P DIR=LTR><I><SPAN LANG="en-us"><FONT COLOR="#008080" FACE="Trebuchet MS">Seattle, WA 98105</FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">TOP_OF_MAIN_SECTION</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  arrmblsize=20000000; </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">DATA_SECTION</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_int Nobs; // number of observations</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_int Ntrips; // number of trips</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_int Ntripobs; // number of observations per trip</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_matrix Obs(1,Nobs,1,4); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  vector treatment(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  vector trip(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  vector distt(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  vector theta(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  !!treatment = column(</FONT><FONT FACE="Times New Roman">Obs,1); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  !!trip = column(Obs,2); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  !!distt = column(Obs,3); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  !!theta = column(Obs,4);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pi;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  //stdevs on random effects</FONT><FONT FACE="Times New Roman"></FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">–</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"> fixed</FONT> <FONT FACE="Times New Roman">in this version</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_scale2;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_shape2;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_rho2;  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_scale3;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_shape3;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number sigma_rho3;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT> <FONT FACE="Times New Roman">//</FONT><FONT FACE="Times New Roman">transition parameters</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">–</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"> fixed in this version</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch11;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch12;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch13;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch21;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch22;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch23;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch31;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch32;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  number pswitch33;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">   </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  !! cout<<"done reading</FONT> <FONT FACE="Times New Roman">data"<<endl; // indicates data has been read in</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">INITIALIZATION_SECTION</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  //</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">global parameters for weibull on distance and wrapped cauchy on turning angle</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">input_mode2_scale -2.3</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  input_mode2_shape -0.22</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  input_mode2_rho -0.32</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  input_mode3_scale -0.22</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  input_mode3_shape 1.61</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  input_mode3_rho 2.4</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> </SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">//</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">treatment effects</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode2_scale_treat 0.69</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode2_shape_treat 0</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode2_rho_treat 0.5</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode3_scale_treat 0.41</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode3_shape_treat 0.18</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  mode3_rho_treat 0.69</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">     </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">PARAMETER_SECTION</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number input_mode2_scale(1); //global parameters</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">init_number input_mode2_shape(1); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number input_mode2_rho(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number input_mode3_scale(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number input_mode3_shape(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number input_mode3_rho(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode2_scale_treat(1); //treatment effects</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode2_</FONT><FONT FACE="Times New Roman">shape_treat(1); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode2_rho_treat(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode3_scale_treat(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode3_shape_treat(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  init_number mode3_rho_treat(1);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  random_effects_matrix u(1,Ntrips,1,6,2); // matrix of unscaled random effects: re=sigma_re*u w</FONT><FONT FACE="Times New Roman">here u~N(0,1)</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  objective_function_value obj_fun;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">PROCEDURE_SECTION</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  int t, obs; //counters for trip and all observations</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  obs=0; </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  obj_fun=0; //resets objective function</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  // loop over trips  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">for (t=1;t<=Ntrips;t++)</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        fit_trip(input_mode2_scale, input_mode2_shape, input_mode2_rho, input_mode3_scale, input_mode3_shape, input_mode3_rho, mode2_scale_treat, mode2_shape_treat, mode2_rho_treat, mode3_scale_treat, mode3_shape_treat, mode3_rho_treat, u(t), t, obs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">SEPARABLE_FUNCTION void fit_trip(const dvariable& input_mode2_scale, const dvariable& input_mode2_shape, const dvariable& input_mode2_rho, const dvariable& input_mode3_scale, const dvariable& input_mode3_shape, const dvariable& input_m</FONT><FONT FACE="Times New Roman">ode3_rho, const dvariable& mode2_scale_treat, const dvariable& mode2_shape_treat, const dvariable& mode2_rho_treat, const dvariable& mode3_scale_treat, const dvariable& mode3_shape_treat, const dvariable& mode3_rho_treat, const dvar_vector& ut, const int&</FONT><FONT FACE="Times New Roman"></FONT> <FONT FACE="Times New Roman">t, int obs) </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  obs = (t-1)*Ntripobs; //sets obs for beginning of each trip</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  int i; // loop counter</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pi = 3.141593; //specifies pi</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  sigma_scale2=0.01;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  sigma_shape2=0.01;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  sigma_rho2 = 0.01;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"></FONT> <FONT FACE="Times New Roman"> sigma_scale3=0.01;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  sigma_shape3=0.1;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  sigma_rho3 = 0.001;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector priorfor_mode1(1,Nobs);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector priorfor_mode2(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector prior</FONT><FONT FACE="Times New Roman">for_mode3(1,Nobs);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector likefor_mode1(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector likefor_mode2(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector likefor_mode3(1,Nobs);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector probfor_mode1(1,Nobs);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector probfor_mode2(1,Nobs); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvar_vector probfor_mode3(1,Nobs);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  obj_fun-=(-0.5*norm2(ut)); //</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">likelihood contribution from</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">unscaled random effects based on the prior ~N(0,1)</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  //scale & shape passed thro log filter, rho thro arctan filter </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvariable mode2_scale=mfexp(input_mod</FONT><FONT FACE="Times New Roman">e2_scale+(treatment(obs+1)*mode2_scale_treat))+(sigma_scale2*ut(1));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman"> </FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">dvariable mode2_shape=mfexp(input_mode2_shape+(treatment(obs+1)*mode2_shape_treat))+(sigma_shape2*ut(2));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvariable mode2_rho=(0.5+atan(input_mode2_rho+(treatment(obs+1)*mode2_rho_tre</FONT><FONT FACE="Times New Roman">at))/pi)+(sigma_rho2*ut(3));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvariable mode3_scale=mfexp(input_mode3_scale+(treatment(obs+1)*mode3_scale_treat))+(sigma_scale3*ut(4));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvariable mode3_shape=mfexp(input_mode3_shape+(treatment(obs+1)*mode3_shape_treat))+(sigma_shape3*ut(5));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  dvariable</FONT><FONT FACE="Times New Roman"> mode3_rho=(0.5+atan(input_mode3_rho+(treatment(obs+1)*mode3_rho_treat))/pi)+(sigma_rho3*ut(6));</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch11= 0.1 + (treatment(obs+1)*(-0.05)); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch12= 0.6 + (treatment(obs+1)*0.1); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch13= 1 - pswitch11 - pswitch12;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch21= 0.03 + (treatment(obs+1)*0.02); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch22= 0.9 + (treatment(obs+1)*(-0.1)); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch23= 1 - pswitch21 - pswitch22;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch31= 0.05 + (treatment(obs+1)*0); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch32= 0.1 + (treatment(obs+1)*(-0.05)); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  pswitch33= 1 - pswitch31 - pswitch32;</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  //first</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">obs</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">n</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"></FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">does not contribute to the likelihood</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">, but</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">contributes to</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"> priors for second</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">obs</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">n</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  probfor_mode1(obs+1)=0;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  probfor_mode2(obs+1)=0.5;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  probfor_mode3(obs+1)=0.5;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  for (i=obs+2;i<=obs+Ntripobs-1;i++)</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  {</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        if (theta(i)==0)</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        {</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode1(i)=1;</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman"> //</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">obs</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">n</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">s with incomplete mov</FONT><FONT FACE="Times New Roman">ement data automatically assigned to mode1; do not contribute to likelihood,</FONT><FONT FACE="Times New Roman"> but contribute to priors for subsequent</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Times New Roman">obs</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">n</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT FACE="Times New Roman">s</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode2(i)=0;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode3(i)=0;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        } else</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us">        <FONT FACE="Times New Roman">{</FONT><FONT FACE="Times New Roman">    </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        priorfor_mode2(i)</FONT><FONT FACE="Times New Roman">=(probfor_mode1(i-1)*pswitch12) + (probfor_mode2(i-1)*pswitch22) + (probfor_mode3(i-1)*pswitch32);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        priorfor_mode3(i)=(probfor_mode1(i-1)*pswitch12) + (probfor_mode2(i-1)*pswitch23) + (probfor_mode3(i-1)*pswitch33);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        likefor_mode2(i)=(mode</FONT><FONT FACE="Times New Roman">2_shape/mode2_scale)*(pow(distt(i)/mode2_scale, mode2_shape-1)*mfexp(-1*pow(distt(i)/mode2_scale,mode2_shape))) * (1/(2*pi))*(1-pow(mode2_rho,2))/(1+pow(mode2_rho,2)-(2*mode2_rho*cos(theta(i))))*priorfor_mode2(i);  // likelihood for each observation under</FONT><FONT FACE="Times New Roman"></FONT> <FONT FACE="Times New Roman">mode 2</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        likefor_mode3(i)=(mode3_shape/mode3_scale)*(pow(distt(i)/mode3_scale, mode3_shape-1)*mfexp(-1*pow(distt(i)/mode3_scale,mode3_shape))) * (1/(2*pi))*(1-pow(mode3_rho,2))/(1+pow(mode3_rho,2)-(2*mode3_rho*cos(theta(i))))*priorfor_mode3(i);</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">    </FONT> <FONT FACE="Times New Roman">   </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode1(i)=0;</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode2(i)=likefor_mode2(i)/(likefor_mode2(i) + likefor_mode3(i));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        probfor_mode3(i)=likefor_mode3(i)/(likefor_mode2(i) + likefor_mode3(i));</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        obj_fun-= log(likefor_mode2(i) + likefor_mode</FONT><FONT FACE="Times New Roman">3(i)); </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">        }  </FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Times New Roman">  }</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"></SPAN></I><I><SPAN LANG="en-us"><FONT COLOR="#008080" FACE="Trebuchet MS">                  </FONT></SPAN></I><SPAN LANG="en-us"><I></I></SPAN><I><SPAN LANG="en-us"> </SPAN></I></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>

</BODY>
</HTML>