private double createBaseline(double[] time, int[] censor, double[] output)
        {
            if (regression.BaselineHazard != null)
            {
                IFittingOptions options = null;

                if (regression.BaselineHazard is IFittableDistribution <double, EmpiricalHazardOptions> )
                {
                    // Compute an estimate of the cumulative Hazard
                    //   function using the Nelson-Aalen estimator
                    options = new EmpiricalHazardOptions()
                    {
                        Censor    = censor,
                        Output    = output,
                        Estimator = HazardEstimator.BreslowNelsonAalen
                    };
                }
                else if (regression.BaselineHazard is IFittableDistribution <double, SurvivalOptions> )
                {
                    // Compute an estimate of the cumulative Hazard
                    //   function using the Nelson-Aalen estimator
                    options = new SurvivalOptions()
                    {
                        Censor = censor
                    };
                }

                regression.BaselineHazard.Fit(time, null, options);
            }

            return(0);
        }
 /// <summary>
 ///   Fits the underlying distribution to a given set of observations.
 /// </summary>
 ///
 /// <param name="observations">The array of observations to fit the model against. The array
 /// elements can be either of type double (for univariate data) or
 /// type double[] (for multivariate data).</param>
 /// <param name="weights">The weight vector containing the weight for each of the samples.</param>
 /// <param name="options">Optional arguments which may be used during fitting, such
 /// as regularization constants and additional parameters.</param>
 ///
 public void Fit(double[] observations, double[] weights, EmpiricalHazardOptions options)
 {
     Fit(observations, weights, options as SurvivalOptions);
 }