started removing KLib related code:
- assertions - distributions new helper methods worked on stairs worked on grid-walkers worked on navigation
This commit is contained in:
22
math/distribution/Logistic.h
Normal file
22
math/distribution/Logistic.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef LOGISTIC_H
|
||||
#define LOGISTIC_H
|
||||
|
||||
|
||||
namespace Distribution {
|
||||
|
||||
// https://de.wikipedia.org/wiki/Logistische_Verteilung
|
||||
template <typename T> class Logistic {
|
||||
|
||||
public:
|
||||
|
||||
/** alpha = move the center, beta = slope */
|
||||
static T getCDF(const T x, const T alpha, const T beta) {
|
||||
return 1 / (1 + std::exp( -((x-alpha)/beta) ) );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // LOGISTIC_H
|
||||
Reference in New Issue
Block a user