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

@param x - arithmetic-scale value
@return - logit-scale value
Calculate logit - scale value corresponding to given bounded arithmetic - scale value . @param x - arithmetic - scale value @return - logit - scale value
double BoundedNumberInfo::calcParamScaleVal(double x){
    if (debug) rpt::echo<<"starting BoundedNumberInfo::calcParamScaleVal(double&) "<<this<<endl;
    double y,z;
    switch (scaleType){
        case tcsam::SCALE_ARITHM:
            z = x;
            break;
        case tcsam::SCALE_LOG:
            z = log(x);
            break;
        case tcsam::SCALE_LOGIT:
            if (x<=lower) return -25.0;
            if (x>=upper) return 25.0;
            y = (x-lower)/(upper-lower);
            z = log(y/(1.0-y));
            break;
        default:
            cout<<"BoundedNumberInfo::calcParamScaleVal(double) "<<this<<endl;
            cout<<"Parameter scale type "<<scaleType<<" not recognized!!"<<endl;
            ad_exit(1);
            break;
    }
    if (debug) rpt::echo<<"finished BoundedNumberInfo::calcParamScaleVal(double&) "<<this<<endl;
    return z;
}
double BoundedNumberInfo :: calcParamScaleVal ( 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 = log ( x ) ; break ; case tcsam :: SCALE_LOGIT : if ( x <= lower ) return -25.0 ; if ( x >= upper ) return 25.0 ; y = ( x - lower ) / ( upper - lower ) ; z = log ( y / ( 1.0 - y ) ) ; break ; default : cout << " " << this << endl ; cout << " " << scaleType << " " << endl ; ad_exit ( 1 ) ; break ; } if ( debug ) rpt :: echo << " " << this << endl ; return z ; }
Calculate logit-scale value corresponding to given bounded arithmetic-scale value.
Calculate logit - scale value corresponding to given bounded arithmetic - scale value .
//scaled from [lower,upper] to [0,1] //on logit scale