code: private RandomVariableInterface[] getBasisFunctions(RandomVariableInterface underlying) {
  		double min = underlying.getMin();
  		double max = underlying.getMax();
  
  		ArrayList<RandomVariableInterface> basisFunctionList = new ArrayList<RandomVariableInterface>();
  		double[] discretization = (new TimeDiscretization(min, numberOfBins, (max-min)/numberOfBins)).getAsDoubleArray();
  		for(double discretizationStep : discretization) {
  			RandomVariableInterface indicator = underlying.barrier(underlying.sub(discretizationStep), new RandomVariable(1.0), 0.0);
  			basisFunctionList.add(indicator);
  		}
  
  		return basisFunctionList.toArray(new RandomVariableInterface[0]);
  	}
docs: Create basis functions for a binning.
  
  @param underlying
  @return