<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_types(parameters, parameter_types, strict_floats):
 """Checks that the given parameters have the correct types. :param parameters: List of (name, value) pairs of the given parameters :type parameters: dict[str, object] :param parameter_types: Parameter type by name. :type parameter_types: dict[str, type] :param strict_floats: If False, treat integers as floats :type strict_floats: bool """

    for name, parameter_type in parameter_types.items():
        if name not in parameters:
            raise InvalidParamsError("Parameter '{}' is missing.".format(name))
        if not _is_instance(parameters[name], parameter_type, strict_floats):
            raise InvalidParamsError("Value '{}' for parameter '{}' is not of expected type {}."
                                     .format(parameters[name], name, parameter_type))