Many activity dependent learning rules have been proposed in order to model long-term potentiation (LTP). Our aim is to derive a spike time dependent learning rule from a probabilistic optimality criterion. Our approach allows us to obtain quantitative results in terms of a learning window. This is done by maximising a given likelihood function with respect to the synaptic weights. The resulting weight adaptation is compared with experimental results.