src/ModelParameterInfoTypes.cpp
/**
 * Calculate bounded arithmetic-scale value corresponding to parameter-scale value.
 * 
 * @param x - parameter-scale value
 * @return - arithmetic-scale value
 */
Calculate bounded arithmetic-scale value corresponding to parameter-scale value.

@param x - parameter-scale value
@return - arithmetic-scale value
Calculate bounded arithmetic - scale value corresponding to parameter - scale value . @param x - parameter - scale value @return - arithmetic - scale value
double BoundedNumberInfo::calcArithScaleVal(double x){
    if (debug) rpt::echo<<"starting BoundedNumberInfo::calcArithScaleVal(double&) "<<this<<endl;
    double y, z;
    switch (scaleType){
        case tcsam::SCALE_ARITHM:
            z = x;
            break;
        case tcsam::SCALE_LOG:
            z = mfexp(x);
            break;
        case tcsam::SCALE_LOGIT:
            y = 1.0/(1.0+exp(-x));
            z = lower+(upper-lower)*y;
            break;
        default:
            cout<<"BoundedNumberInfo::calcArithScaleVal(double&) "<<this<<endl;
            cout<<"Parameter scale type "<<scaleType<<" not recognized!!"<<endl;
            ad_exit(1);
            break;
    }
    if (debug) rpt::echo<<"starting BoundedNumberInfo::calcArithScaleVal(double&) "<<this<<endl;
    return z;
}
double BoundedNumberInfo :: calcArithScaleVal ( double x ) { if ( debug ) rpt :: echo << " " << this << endl ; double y , z ; switch ( scaleType ) { case tcsam :: SCALE_ARITHM : z = x ; break ; case tcsam :: SCALE_LOG : z = mfexp ( x ) ; break ; case tcsam :: SCALE_LOGIT : y = 1.0 / ( 1.0 + exp ( - x ) ) ; z = lower + ( upper - lower ) * y ; break ; default : cout << " " << this << endl ; cout << " " << scaleType << " " << endl ; ad_exit ( 1 ) ; break ; } if ( debug ) rpt :: echo << " " << this << endl ; return z ; }
Calculate bounded arithmetic-scale value corresponding to parameter-scale value.
Calculate bounded arithmetic - scale value corresponding to parameter - scale value .
//scaled to [0,1]