A method for predicting the condition of a machine or a component of the machine based on measurements of a condition monitoring parameter, wherein a potential failure level (X P) of the condition monitoring parameter has been defined, at which level damage of the machine or component is considered initiated, a pattern for the condition monitoring parameter has been defined, which pattern reflects an expected behavior of the monitoring parameter after damage has been initiated, and a plurality of measurement values of the condition monitoring parameter have been stored in a moving window, wherein the method comprises: a) obtaining a new measurement value (X i (t)) of the condition monitoring parameter, b) comparing the new measurement value with the latest stored measurement value, and discard the new measurement value if it is smaller than the latest stored measurement value, and otherwise replace the oldest of the measurement values stored in the moving window with the new measurement value, c) comparing the new measurement value with the potential failure level of the condition monitoring parameter, and repeating the steps a - c until the new measurement value exceeds the potential failure level of the condition monitoring parameter, and d) determining the point in time (t P) when the monitoring parameter exceeded the potential failure level, e) receiving a new measurement value of the condition monitoring parameter, f) comparing the new measurement value with the latest stored measurement value, and discarded the new measurement value if it is smaller than the latest stored measurement value, g) comparing the new measurement value with an expected value (X(t 1)) determined in accordance with said defined pattern for the condition monitoring parameter and the time elapsed (At) since the point in time the monitoring parameter exceeded the potential failure level, and discard the new measurement value if it deviates too much from the pattern, and otherwise replace the oldest of the measurement values stored in the moving window with the new measurement value, and h) predicting the level of the condition monitoring parameter at a future point in time based on the measurement values stored in the moving window. a) obtaining a new measurement value (X i (t)) of the condition monitoring parameter, b) comparing the new measurement value with the latest stored measurement value, and discard the new measurement value if it is smaller than the latest stored measurement value, and otherwise replace the oldest of the measurement values stored in the moving window with the new measurement value, c) comparing the new measurement value with the potential failure level of the condition monitoring parameter, and repeating the steps a - c until the new measurement value exceeds the potential failure level of the condition monitoring parameter, and d) determining the point in time (t P) when the monitoring parameter exceeded the potential failure level, e) receiving a new measurement value of the condition monitoring parameter, f) comparing the new measurement value with the latest stored measurement value, and discarded the new measurement value if it is smaller than the latest stored measurement value, g) comparing the new measurement value with an expected value (X(t 1)) determined in accordance with said defined pattern for the condition monitoring parameter and the time elapsed (At) since the point in time the monitoring parameter exceeded the potential failure level, and discard the new measurement value if it deviates too much from the pattern, and otherwise replace the oldest of the measurement values stored in the moving window with the new measurement value, and h) predicting the level of the condition monitoring parameter at a future point in time based on the measurement values stored in the moving window.