Revision 1483 trunk/contrib/statslib/logistic.cpp
logistic.cpp (revision 1483)  

113  113 
} 
114  114 
return 1./(1.+mfexp((locationx)/scale)); 
115  115 
} 
116 


116  
117 
/** 

118 
* Template function for plogis 

119 
* \author Steven Martell 

120 
* \param x is a vector of quantiles. 

121 
* \param location is where 50% percentile occurs. 

122 
* \param scale determines in the standard deviation of the distribution. 

123 
* 

124 
* \return a template vector 

125 
*/ 

126 
template <typename T1, typename T2> 

127 
T1 plogis( const T1& x, const T2& location, const T2& scale ) 

128 
{ 

129 
if( scale<=0 ) 

130 
{ 

131 
cerr<<"Standard deviation is less than or equal to zero in " 

132 
"plogis( const dvar_vector& x, const dvariable& location, const dvariable& scale )\n"; 

133 
return 0; 

134 
} 

135 
return 1./(1.+mfexp((locationx)/scale)); 

136 
} 
Also available in: Unified diff