A computer-implemented method for controlling a vehicle the method comprising the steps of: receiving a symbolic regular expression defining a complex event; receiving, from sensors of a vehicle, an event stream including a plurality of events upon which a forecast is to be based, the plurality of events including location data from the vehicle; constructing a probabilistic model by means of a deterministic symbolic finite automaton derived from the symbolic regular expression and of a variable-order Markov model encoding statistical properties of at least a portion of the received event stream, the portion of the received event stream acting as a training dataset, each transition of the deterministic symbolic finite automaton being equipped with a unary formula from an effective Boolean algebra, wherein the probabilistic model is constructed by: constructing a streaming finite symbolic automaton based on and/or equivalent to the symbolic regular expression; constructing the deterministic symbolic finite automaton based on and/or equivalent to the streaming finite symbolic automaton; using minterms of the deterministic symbolic finite automaton and the portion of the received event stream to create and learn a probabilistic suffix automaton as the variable-order Markov model, the probabilistic suffix automaton encoding the statistical properties of the portion of the received event stream; and combining the deterministic symbolic finite automaton and the probabilistic suffix automaton into a single automaton; forecasting, by the single automaton embedding the deterministic symbolic finite automaton and the probabilistic suffix automaton, a complex event for the received event stream by determining when the single automaton is expected to reach one of its final states for the first time while continuously updating the variable-order Markov model in an online manner based on the received event stream, wherein the forecasted complex event matches the received symbolic regular expression; and controlling the vehicle based on the forecasted complex event. receiving a symbolic regular expression defining a complex event; receiving, from sensors of a vehicle, an event stream including a plurality of events upon which a forecast is to be based, the plurality of events including location data from the vehicle; constructing a probabilistic model by means of a deterministic symbolic finite automaton derived from the symbolic regular expression and of a variable-order Markov model encoding statistical properties of at least a portion of the received event stream, the portion of the received event stream acting as a training dataset, each transition of the deterministic symbolic finite automaton being equipped with a unary formula from an effective Boolean algebra, wherein the probabilistic model is constructed by: constructing a streaming finite symbolic automaton based on and/or equivalent to the symbolic regular expression; constructing the deterministic symbolic finite automaton based on and/or equivalent to the streaming finite symbolic automaton; using minterms of the deterministic symbolic finite automaton and the portion of the received event stream to create and learn a probabilistic suffix automaton as the variable-order Markov model, the probabilistic suffix automaton encoding the statistical properties of the portion of the received event stream; and combining the deterministic symbolic finite automaton and the probabilistic suffix automaton into a single automaton; constructing a streaming finite symbolic automaton based on and/or equivalent to the symbolic regular expression; constructing the deterministic symbolic finite automaton based on and/or equivalent to the streaming finite symbolic automaton; using minterms of the deterministic symbolic finite automaton and the portion of the received event stream to create and learn a probabilistic suffix automaton as the variable-order Markov model, the probabilistic suffix automaton encoding the statistical properties of the portion of the received event stream; and combining the deterministic symbolic finite automaton and the probabilistic suffix automaton into a single automaton; forecasting, by the single automaton embedding the deterministic symbolic finite automaton and the probabilistic suffix automaton, a complex event for the received event stream by determining when the single automaton is expected to reach one of its final states for the first time while continuously updating the variable-order Markov model in an online manner based on the received event stream, wherein the forecasted complex event matches the received symbolic regular expression; and controlling the vehicle based on the forecasted complex event.