<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_rho_and_rho_bar_squared(final_log_likelihood, null_log_likelihood, num_est_parameters):
 """ Calculates McFadden's rho-squared and rho-bar squared for the given model. Parameters final_log_likelihood : float. The final log-likelihood of the model whose rho-squared and rho-bar squared are being calculated for. null_log_likelihood : float. The log-likelihood of the model in question, when all parameters are zero or their 'base' values. num_est_parameters : int. The number of parameters estimated in this model. Returns ------- `(rho_squared, rho_bar_squared)` : tuple of floats. The rho-squared and rho-bar-squared for the model. """

    rho_squared = 1.0 - final_log_likelihood / null_log_likelihood
    rho_bar_squared = 1.0 - ((final_log_likelihood - num_est_parameters) /
                             null_log_likelihood)

    return rho_squared, rho_bar_squared