#NEWLINE# def infer_newX( model , Y_new , optimize = True , init = 'L2' ) : #NEWLINE# #INDENT# '\n    Infer the distribution of X for the new observed data *Y_new*.\n\n    :param model: the GPy model used in inference\n    :type model: GPy.core.Model\n    :param Y_new: the new observed data for inference\n    :type Y_new: numpy.ndarray\n    :param optimize: whether to optimize the location of new X (True by default)\n    :type optimize: boolean\n    :return: a tuple containing the estimated posterior distribution of X and the model that optimize X\n    :rtype: (GPy.core.parameterization.variational.VariationalPosterior, GPy.core.Model)\n    ' #NEWLINE# infr_m = InferenceX ( model , Y_new , init = init ) #NEWLINE# if optimize : #NEWLINE# #INDENT# infr_m . optimize ( ) #NEWLINE# #UNINDENT# return ( infr_m . X , infr_m )