← Back to Problems
Exposure Targets
Easy prediction Linear Algebra Portfolio Optimization
Time limit: 4 s per test  ·  Memory: 256 MB

Your book holds n assets with weights w0. Risk tracks k linear exposures of the book (net exposure, beta, sector exposures), written as A w with a k x n matrix A, and has told you where they have to be by end of day: a vector b of target exposures. The book is not there: A w0 != b.

Find the trade Delta that moves the book to the targets, A (w0 + Delta) = b, with the smallest possible risk Delta^T Sigma Delta, where Sigma is the covariance matrix of daily returns. Sigma is not disclosed; you are given T days of past returns of the n assets, drawn independently from a multivariate normal distribution with covariance Sigma.

Input

The first line contains n, T and k. The second line contains the n weights w0. Each of the next k lines contains one exposure: the n entries of a row of A, followed by the corresponding target entry of b. Each of the next T lines contains the n returns of one day, with 6 digits after the decimal point.

Output

n real numbers: the trade Delta, one value per asset.

Scoring

An output is rejected (score 0) unless it has exactly n finite values and every target is met: |A (w0 + Delta) - b| <= 1e-6 in each row. Otherwise the case score is

score = V_min / V

where V = Delta^T Sigma Delta is the risk of your trade under the true Sigma and V_min is the smallest risk of any trade that meets the targets. The total score is the mean over the cases.

Constraints

15 <= n <= 30

10 n <= T <= 15 n

2 <= k <= 4

The rows of A are linearly independent, and A w0 != b in every case.

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
Discussion
No comments yet. Kick off the discussion.