← Back to Problems
Square-Root Diffusion
Medium prediction Stochastic Calculus Time Series
Time limit: 8 s per test  ·  Memory: 256 MB

A short-term interest rate X_t follows the square-root (Cox–Ingersoll–Ross) diffusion

dX_t = kappa (theta - X_t) dt + sigma sqrt(X_t) dW_t,

with kappa, theta, sigma > 0 not disclosed and varying between test cases.

You observe n quarterly observations X_1, ..., X_n (time step 0.25 years). Test series are selected so that the last observation lies well away from the rate's long-run level. For each horizon h = 1, ..., H quarters ahead, forecast the conditional distribution of X_{n+h} given the observations through its 5%, 50% (median) and 95% quantiles.

Input

The first line contains n and H. Each of the next n lines contains one observation, with 8 digits after the decimal point.

Output

H lines. Line h contains three real numbers: the 5% quantile, the median and the 95% quantile of X_{n+h}.

Scoring

A quantile forecast q_hat at level tau scores L*(tau) / L(q_hat, tau), where L(q, tau) is the expected pinball loss E[ rho_tau(X_{n+h} - q) ] under the true conditional law of X_{n+h} and L*(tau) is its minimum, attained by the true quantile. The case score is the mean of the 3H efficiencies.

Constraints

n = 400

H = 4

Python 3.13 i Execution environment Isolated microVM · 1 vCPU · no internet access Time and memory limits are set per problem Available packages numpy 2.5.0scipy 1.18.0pandas 3.0.0scikit-learn 1.9.0statsmodels 0.15.0cvxpy 1.9.2