A pairs trading desk watches the spread X_t between two cointegrated stocks. The spread follows an Ornstein-Uhlenbeck process
dX_t = theta * (mu - X_t) dt + sigma dW_t
starting at X_0 = x_0.
Compute three quantities for the spread at time T: its expectation, its variance, and the probability that it is above the level c.
Six numbers theta, mu, sigma, x_0, c and T, each with at most 6 digits after the decimal point.
Three real numbers on one line: E[X_T], Var(X_T) and P(X_T > c), each with absolute or relative error at most 1e-9.
0.01 <= theta <= 10
-10 <= mu, x_0, c <= 10
0.01 <= sigma <= 5
0.001 <= T <= 50
This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.
Numeric answers are accepted if they are within an absolute tolerance of 1e-09 or a relative tolerance of 1e-09 of the expected value.
1 0 1 1 0 1
3.678794411714e-01 4.323323583817e-01 7.120882208899e-01
2 1.5 0.5 -1 1.5 10
1.499999994847e+00 6.250000000000e-02 4.999999917772e-01