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

123  123 
* 
124  124 
* \return a template vector 
125  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 
} 

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