test_class.file: jtstoolkit/src/test/java/ec/tstoolkit/eco/discrete/DiscreteModelTest.java
test_class.identifier: DiscreteModelTest
test_case.body: @Test
      public void demoSomeMethod() {
          int n=10000;
          int[] y=new int[n];
          for (int i=0; i<y.length; ++i){
              y[i]=i<n/2 ? 0 :1;
          }
          
          Matrix M =new Matrix(n, 100);
          M.randomize();
          M.add(-.5);
          M.column(0).set(1);
          
          DiscreteModel model=new DiscreteModel(new Probit());
          //LbfgsMinimizer min=new LbfgsMinimizer();
          //min.setMemoryLength(3);
          //model.setMinimizer(min);
          DiscreteModelEvaluation rslt = model.process(y, M);
          IReadDataBlock parameters = rslt.getParameters();
          System.out.println(parameters);
          System.out.println(new DataBlock(rslt.gradient()));
          model=new DiscreteModel(new Logit());
          rslt = model.process(y, M);
          parameters = rslt.getParameters();
          System.out.println(parameters);
          System.out.println(new DataBlock(rslt.gradient()));
      }
test_case.class_method_signature: DiscreteModelTest.demoSomeMethod()
test_case.full_signature: @Test public void demoSomeMethod()
test_case.identifier: demoSomeMethod
test_case.invocations: randomize add set column process getParameters println println gradient process getParameters println println gradient
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void demoSomeMethod()
focal_class.declarator: m_y
focal_class.modifier: private
focal_class.original_string: private int[] m_y;
focal_class.type: int[]
focal_class.var_name: m_y
focal_class.declarator: m_x
focal_class.modifier: private
focal_class.original_string: private Matrix m_x;
focal_class.type: Matrix
focal_class.var_name: m_x
focal_class.declarator: m_fn
focal_class.modifier: private final
focal_class.original_string: private final ICumulativeDistributionFunction m_fn;
focal_class.type: ICumulativeDistributionFunction
focal_class.var_name: m_fn
focal_class.declarator: minimizer = new LbfgsMinimizer()
focal_class.modifier: private
focal_class.original_string: private IFunctionMinimizer minimizer = new LbfgsMinimizer();
focal_class.type: IFunctionMinimizer
focal_class.var_name: minimizer
focal_class.file: jtstoolkit/src/main/java/ec/tstoolkit/eco/discrete/DiscreteModel.java
focal_class.identifier: DiscreteModel
focal_class.class_method_signature: DiscreteModel.DiscreteModel(ICumulativeDistributionFunction fn)
focal_class.full_signature: public  DiscreteModel(ICumulativeDistributionFunction fn)
focal_class.identifier: DiscreteModel
focal_class.modifiers: public
focal_class.parameters: (ICumulativeDistributionFunction fn)
focal_class.signature:  DiscreteModel(ICumulativeDistributionFunction fn)
focal_class.class_method_signature: DiscreteModel.process(int[] y, Matrix X)
focal_class.full_signature: public DiscreteModelEvaluation process(int[] y, Matrix X)
focal_class.identifier: process
focal_class.modifiers: public
focal_class.parameters: (int[] y, Matrix X)
focal_class.return: DiscreteModelEvaluation
focal_class.signature: DiscreteModelEvaluation process(int[] y, Matrix X)
focal_class.class_method_signature: DiscreteModel.probabilities(DataBlock b)
focal_class.full_signature: public double[] probabilities(DataBlock b)
focal_class.identifier: probabilities
focal_class.modifiers: public
focal_class.parameters: (DataBlock b)
focal_class.return: double[]
focal_class.signature: double[] probabilities(DataBlock b)
focal_class.class_method_signature: DiscreteModel.loglikelihood(DataBlock b)
focal_class.full_signature: public double loglikelihood(DataBlock b)
focal_class.identifier: loglikelihood
focal_class.modifiers: public
focal_class.parameters: (DataBlock b)
focal_class.return: double
focal_class.signature: double loglikelihood(DataBlock b)
focal_class.class_method_signature: DiscreteModel.getCumulativeDistributionFunction()
focal_class.full_signature: public ICumulativeDistributionFunction getCumulativeDistributionFunction()
focal_class.identifier: getCumulativeDistributionFunction
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ICumulativeDistributionFunction
focal_class.signature: ICumulativeDistributionFunction getCumulativeDistributionFunction()
focal_class.class_method_signature: DiscreteModel.dloglikelihood(DataBlock b, int i)
focal_class.full_signature: public double dloglikelihood(DataBlock b, int i)
focal_class.identifier: dloglikelihood
focal_class.modifiers: public
focal_class.parameters: (DataBlock b, int i)
focal_class.return: double
focal_class.signature: double dloglikelihood(DataBlock b, int i)
focal_class.class_method_signature: DiscreteModel.loglikelihoodGradient(DataBlock b)
focal_class.full_signature: public double[] loglikelihoodGradient(DataBlock b)
focal_class.identifier: loglikelihoodGradient
focal_class.modifiers: public
focal_class.parameters: (DataBlock b)
focal_class.return: double[]
focal_class.signature: double[] loglikelihoodGradient(DataBlock b)
focal_class.class_method_signature: DiscreteModel.logLikelihoodHessian(DataBlock b)
focal_class.full_signature: public Matrix logLikelihoodHessian(DataBlock b)
focal_class.identifier: logLikelihoodHessian
focal_class.modifiers: public
focal_class.parameters: (DataBlock b)
focal_class.return: Matrix
focal_class.signature: Matrix logLikelihoodHessian(DataBlock b)
focal_class.class_method_signature: DiscreteModel.getY()
focal_class.full_signature: public int[] getY()
focal_class.identifier: getY
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int[]
focal_class.signature: int[] getY()
focal_class.class_method_signature: DiscreteModel.getX()
focal_class.full_signature: public Matrix getX()
focal_class.identifier: getX
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Matrix
focal_class.signature: Matrix getX()
focal_class.class_method_signature: DiscreteModel.initialize()
focal_class.full_signature: protected double[] initialize()
focal_class.identifier: initialize
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] initialize()
focal_class.class_method_signature: DiscreteModel.getMinimizer()
focal_class.full_signature: public IFunctionMinimizer getMinimizer()
focal_class.identifier: getMinimizer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IFunctionMinimizer
focal_class.signature: IFunctionMinimizer getMinimizer()
focal_class.class_method_signature: DiscreteModel.setMinimizer(IFunctionMinimizer minimizer)
focal_class.full_signature: public void setMinimizer(IFunctionMinimizer minimizer)
focal_class.identifier: setMinimizer
focal_class.modifiers: public
focal_class.parameters: (IFunctionMinimizer minimizer)
focal_class.return: void
focal_class.signature: void setMinimizer(IFunctionMinimizer minimizer)
focal_method.body: public DiscreteModelEvaluation process(int[] y, Matrix X) {
          m_y = y;
          m_x = X;
  
          // initialization 
          double[] c = initialize();
          // create the function 
          llFn fn = new llFn(this);
          // optimization...
          if (getMinimizer().minimize(fn, new DiscreteModelEvaluation(this, new DataBlock(c)))) {
              return (DiscreteModelEvaluation) getMinimizer().getResult();
          } else {
              return null;
          }
      }
focal_method.class_method_signature: DiscreteModel.process(int[] y, Matrix X)
focal_method.full_signature: public DiscreteModelEvaluation process(int[] y, Matrix X)
focal_method.identifier: process
focal_method.invocations: initialize minimize getMinimizer getResult getMinimizer
focal_method.modifiers: public
focal_method.parameters: (int[] y, Matrix X)
focal_method.return: DiscreteModelEvaluation
focal_method.signature: DiscreteModelEvaluation process(int[] y, Matrix X)