From HyPhy Wiki
|This page is a work in progress. Current status of the page is: being populated.|
Optimize (receptacle, likelihood_function_id);
receptacle will contain 2 rows:
- The first row lists all the parameters (global, followed by independent, followed by dependents,...). For order, call fprintf on the likelihood function after setting the environment variable LIKELIHOOD_FUNCTION_OUTPUT = 1
- The second row only has 3 entries.
- Element 1 (): is the value of the likelihood function
- Element 2 (): is the number of independent parameters that were optimized
- Element 3 (): is the number of global(shared) parameters that were optimized.
receptacle: The identifier of the matrix which receives the results.
likelihood_function_id: The likelihood function to be optimized.
likelihood_function_idmust refer to an existing likelihood function OR a user defined function which is to be optimized. In the latter case, the list of independent parameters will be gleaned from function parameter lists.
SetDialogPrompt("Please specify a nucleotide data file:");
DataSet ds = ReadDataFile (PROMPT_FOR_FILE);
DataSetFilter filteredData = CreateFilter (ds,1);
Tree givenTree = DATAFILE_TREE;
LikelihoodFunction lf = (filteredData,givenTree);
Optimize (res, lf);
function userFunction (x,y)
a = Random(0,10);
b = Random(0,10);
Optimize (res, userFunction (a,b));
fprintf (stdout, "", res, "");