<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_goodness_of_fit_csv(observed_simulated_file, out_file=None):
 """ Finds the goodness of fit comparing observed and simulated flows In the file, the first column is the observed flows and the second column is the simulated flows. Example:: 33.5, 77.2 34.7, 73.0 Parameters observed_simulated_file: str Path to the csv file with the observed and simulated flows. out_file: str, optional Path to output file. If not provided, it will print to console. Example: .. code:: python from RAPIDpy.postprocess import find_goodness_of_fit_csv find_goodness_of_fit_csv(' /united_kingdom-thames/flows_kingston_gage_noah.csv') """

    observed_simulated_table = np.loadtxt(observed_simulated_file,
                                          ndmin=2, delimiter=",",
                                          usecols=(0, 1))

    observed_array, simulated_array = \
        filter_nan(observed_simulated_table[:, 0],
                   observed_simulated_table[:, 1])

    # print error indices
    if out_file:
        print_file = open(out_file, 'w')
    else:
        print_file = None

    print("\n".join([
               "Percent Bias: {0:.4f}"
               .format(pc_bias(simulated_array, observed_array)),
               "Absolute Percent Bias: {0:.4f}"
               .format(apb(simulated_array, observed_array)),
               "Root Mean Squared Error: {0:.4f}"
               .format(rmse(simulated_array, observed_array)),
               "Mean Absolute Error: {0:.4f}"
               .format(mae(simulated_array, observed_array)),
               "Bias: {0}".format(bias(simulated_array, observed_array)),
               "Nash Sutcliffe efficiency coefficient: {0:.4f}"
               .format(NS(simulated_array, observed_array)),
               "Likelihood: {0:.4f}"
               .format(L(simulated_array, observed_array)),
               "correlation coefficient: {0:.4f}"
               .format(correlation(simulated_array, observed_array)),
               "index of agreement: {0:.4f}"
               .format(index_agreement(simulated_array, observed_array)),
               "Kling-Gupta Efficiency: {0:.4f}"
               .format(KGE(simulated_array, observed_array)[0]),
               ]),
          file=print_file)

    if print_file:
        print_file.close()