Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Constraint addition term (Read 1390 times)
Nathan Clark
Guest


Constraint addition term
Aug 11th, 2006 at 1:42pm
 
Hello,
I am working on testing a relationship between rates and want to add an addition term to a constraint.

For example, a simple linear between 1 & 2:
rate1 := slope_parameter * rate2 + y-intercept_parameter

The slope_parameter is easy enough, but without the constant, all I can test is a relationship through the origin.
Is it possible to add such an addition term to a constraint?

Thanks for your time,
-Nathan 8)
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Constraint addition term
Reply #1 - Aug 11th, 2006 at 2:04pm
 
Dear Nathan,

You should be able to write the constraint as you have it:

Code:
rate1 := slope_parameter * rate2 + y_intercept_parameter;

 



If you want to use the same constraint for all branches in two trees (where each branch has a parameter 'rate' - change to whatever you actually have) you could write

Code:
global slope_parameter = 1;
global y_intercept_parameter = 0;
global y_intercept_parameter :> -1e25; /* by default all parameters must be >=0; this overrides the behavior */

ReplicateConstraint ("this1.?.rate := slope_parameter * this2.?.rate + y_intercept_parameter", tree1, tree2);

 



HTH,
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