Logistic
Evaluates the logistic regression curve built from a given set of points.
Controller: CodeCogs 
Interface
C++
Excel
Class Logistic
The logit of a numberMISSING IMAGE!
1/reglogistic-378.png cannot be found in /users/1/reglogistic-378.png. Please contact the submission author.
Example 1
- The following example evaluates the logistic curve for a given set of points, which
is also displayed in the previous graph. The abscissas are equally spaced in the interval [10, 50] with a step of 5.
#include <codecogs/maths/regression/logistic.h> #include <iostream> #include <iomanip> using namespace std; int main() { double x[6] = { 28, 29, 30, 31, 32, 33}; double y[6] = {.3333, .4000, .7778, .7778, .8000, .9333}; Maths::Regression::Logistic A(6, x, y); cout << "Logistic regression values" << endl << endl; for (int i = 10; i <= 50; i += 5) { cout << "x = " << setw(3) << i << " y = " << A.getValue(i); cout << endl; } return 0; }
Output:Logistic regression values x = 10 y = 0.143118 x = 15 y = 0.233325 x = 20 y = 0.356719 x = 25 y = 0.502592 x = 30 y = 0.648024 x = 35 y = 0.770364 x = 40 y = 0.859406 x = 45 y = 0.917614 x = 50 y = 0.95304
References:
Wikipedia, http://en.wikipedia.org/wiki/Logistic_regressionAuthors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you buy a Commercial licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
Members of Logistic
Logistic
Initializes the class by calculating the slope and intercept of the corresponding linear regression function.Logistic( int n double* x double* y )[constructor] n The number of points to consider x The x-coordinates of the n points y The y-coordinates of the n points
Logistic Once
doubleLogistic_once( | int | n | |
double* | x | ||
double* | y | ||
double | a | ) |
Example 2
- The following graphs fits a single regression curve to the following values:
x = 23.2 y = 0.02 x = 33.3 y = 0.04 x = 33.5 y = 0.13 x = 34 y = 0.17 x = 34.2 y = 0.18 x = 34.2 y = 0.15 x = 34.4 y = 0.11
There is an error with your graph parameters for Logistic_once with options n=7 x="23.2 33.3 33.5 34 34.2 34.2 34.4" y="0.02 0.04 0.13 0.17 0.18 0.15 0.11" a=0:150 .inputError Message:Function Logistic_once failed. Ensure that: Invalid C++
Parameters
n The number of initial points in the arrays x and y x The x-coordinates for the initial points y The y-coordinates for the initial points a The x-coordinate for the output point
Returns
- the interpolated y-coordinate that corresponds to a.
Source Code
Source code is available when you buy a Commercial licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.