import math


def calculate_rmse(y, yhat):
    """
    Calculates Root Mean Square Error
    :param y: Actual values as series
    :param yhat: Predicted values as series
    :return: RMSE value
    """
    error_sqr = (y - yhat)**2
    error_sqr_rooted = list(map(lambda x: math.sqrt(x), error_sqr))
    rmse = sum(error_sqr_rooted) / len(error_sqr_rooted)

    return rmse