Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Tan() function and Bad Binary Operator Placement (Read 1745 times)
nathanclark111
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 6
Tan() function and Bad Binary Operator Placement
Oct 26th, 2009 at 10:44am
 
I'm working on modeling evolutionary rates for 2 genes jointly in a linear relationship.  Starting with codon models I model their rates using 2 global parameters defining the line ('slope' and 'y-intercept').  I'm trying to add a new feature in which the variable "slope"  is optimized as its tangent. I want to test if this will help with convergence problems.

The error is encountered when trying to implement this.  I added the tangent function into the ReplicateConstraint command and now it will not work.  Simply removing the "Tan()" makes the script work again.  I hope this is a simple syntax error.  THANKS in advance for anyone who can help!

Here is the single offending line of code:
ReplicateConstraint ("this1.?.nonSynRate := Tan(slope) * this2.?.synRate * this3.?.nonSynRate / this4.?.synRate + yint * this5.?.synRate", Tree1, Tree1, Tree2, Tree2, Tree1);

Here is the error message I get:
Bad Binary Operator Placement:  (Tan(slope)) *? Tree1.dmel.synRate ...etc

Here is more context of the offending code:
global slope = 0;
global slope :> -3.14159;
global slope :< 3.14159;
global yint = 0;
global yint :> -1e25;
ReplicateConstraint ("this1.?.nonSynRate := Tan(slope) * this2.?.synRate * this3.?.nonSynRate / this4.?.synRate + yint * this5.?.synRate", Tree1, Tree1, Tree2, Tree2, Tree1);
Optimize (corrA_params, LF);
lnL_A0 = corrA_params[1][0];
fprintf (stdout , "corrA\t" , corrA_params[1][1] , "\t" , corrA_params[1][0] , "\tyint=" , yint,"\tslope=" , (Tan(slope)) , "\n");
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Tan() function and Bad Binary Operator Placement
Reply #1 - Oct 26th, 2009 at 3:06pm
 
Hi Nathan,

Try removing all spaces from the quoted expression in ReplicateConstraint. Also, we have significantly reworked the optimization engine in the current (development) version (Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login; this may help you with convergence issues.

Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged