public void recalculate_intervals(int x_intervals, int y_intervals) { m_x_intervals.repopulate(x_intervals, m_x_min_value, m_x_max_value); m_y_intervals.repopulate(y_intervals, m_y_min_value, m_y_max_value); for (int i = 0; i < m_count; ++i) { m_x_intervals.check_intervals(m_points[i].m_x); m_y_intervals.check_intervals(m_points[i].m_y); } m_x_intervals.find_densities(); m_y_intervals.find_densities(); m_distribution = new bivariate_distribution(m_x_intervals, m_y_intervals); m_distribution.compute_frequencies(m_points); }
public void process_data(int x_intervals, int y_intervals) { m_x_mean = m_points[0].m_x; m_x_min_value = m_points[0].m_x; m_x_max_value = m_points[0].m_x; m_y_mean = m_points[0].m_y; m_y_min_value = m_points[0].m_y; m_y_max_value = m_points[0].m_y; for (int i = 1; i < m_count; ++i) { m_x_mean += Math.Round((double)(m_points[i].m_x - m_x_mean) / (i + 1), 2); m_y_mean += Math.Round((double)(m_points[i].m_y - m_y_mean) / (i + 1), 2); m_x_min_value = m_points[i].m_x < m_x_min_value ? m_points[i].m_x : m_x_min_value; m_x_max_value = m_points[i].m_x > m_x_max_value ? m_points[i].m_x : m_x_max_value; m_y_min_value = m_points[i].m_y < m_y_min_value ? m_points[i].m_y : m_y_min_value; m_y_max_value = m_points[i].m_y > m_y_max_value ? m_points[i].m_y : m_y_max_value; } m_x_range = m_x_max_value - m_x_min_value; m_y_range = m_y_max_value - m_y_min_value; m_x_intervals = new IntervalList(x_intervals, m_x_name); m_y_intervals = new IntervalList(y_intervals, m_y_name); m_x_intervals.populate(m_x_min_value, m_x_max_value); m_y_intervals.populate(m_y_min_value, m_y_max_value); for (int i = 0; i < m_count; ++i) { m_x_intervals.check_intervals(m_points[i].m_x); m_y_intervals.check_intervals(m_points[i].m_y); } m_x_intervals.find_densities(); m_y_intervals.find_densities(); m_distribution = new bivariate_distribution(m_x_intervals, m_y_intervals); m_distribution.compute_frequencies(m_points); }