def parr_to_pdict(arr, measures_optimized):
    """Convert BO parameter tensor to parameter dict"""
    if measures_optimized:
        d = {
            'p_stay_home': arr[0].tolist(),
        }
        return d

    else:
        d = {
            'betas': {
                'education': arr[0].tolist(),
                'social': arr[1].tolist(),
                'bus_stop': arr[2].tolist(),
                'office': arr[3].tolist(),
                'supermarket': arr[4].tolist(),
            },
            'beta_household': arr[5].tolist(),
        }
        return d