The following example performs ordinal logistic regression. There are three levels of response and two intercepts in the output to distinguish the three levels.
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector y = new Vector(0); Vector b = new Vector(0); Vector theta = new Vector(0); Vector se = new Vector(0); Matrix A = new Matrix(0,0,false); double min; TOptStopReason stopreason; y.SetIt(false,new double[] {1,1,2,1,3,2,3,2,3,3}); A.SetIt(false,10,1,new double[] {1,2,3,4,5,6,7,8,9,10}); Regression.LogisticRegress(y,A,b,theta,se,out min, out stopreason, 100,1.0e-8,true); // b = (0.801), theta=(2.779,5.366) } }
|
Copyright (c) 1999-2010 by Dew Research. All rights reserved.
|