跳到主要内容

東京大学 情報理工学系研究科 創造情報学専攻 2013年8月実施 筆記試験 第1問

Author

itsuitsuki

Description

Official examination, archived Japanese PDF. We consider a weather prediction system in which a single senior predictor predicts a weather probability distribution on the basis of NN predictors' prediction results. Below the system is described in details. There are NN weather predictors, each of whom outputs a weather probability distribution once a day. Here the weather is a binary random variable taking a value 1 or 0 only (1 means "fine" while 0 means "not fine"). It is assumed that the weather is independent of a day. Let the probability distribution that the ii-th predictor outputs on the tt-th day be Pi(t)(X)P_i^{(t)}(X) (X{1,0}X \in \{1, 0\}) where we let 0<Pi(t)(X)<10 < P_i^{(t)}(X) < 1 (X{1,0}X \in \{1, 0\}). There is a senior predictor who aggregates the outputs of the NN predictors. On the tt-th day, the senior predictor takes a weighted average over the probability distributions output by the NN predictors to output a weather probability distribution P^(t)(X)\hat{P}^{(t)}(X) (X{1,0}X \in \{1, 0\}). Here the weight on the ii-th predictor on the tt-th day is denoted as vi(t)v_i^{(t)} (i=1Nvi(t)=1,vi(t)>0\sum_{i=1}^N v_i^{(t)} = 1, v_i(t) > 0 (i=1,,Ni = 1, \dots, N)). That is, on the tt-th day, P^(t)(X)\hat{P}^{(t)}(X) is given by i=1Nvi(t)Pi(t)(X)\sum_{i=1}^N v_i^{(t)} P_i^{(t)}(X) (see Figure 1). On the tt-th day, after the senior predictor ouputs, the real outcome xt{1,0}x_t \in \{1, 0\} of the weather on the day is reported. This process goes on sequentially with respect to tt. In the above setting, answer the following questions.

(1) Assume that the senior predictor defines the weight vi(t)v_i^{(t)} of the ii-th predictor on the tt-th day so that the ratio of vi(t)v_i^{(t)}s with respect to ii is equal to that of their corresponding likelihoods with respect to the sequence of the past t1t-1 data: xt1=x1xt1x^{t-1} = x_1 \dots x_{t-1}. That is, when we denote the likelihood of the ii-th predictor with respect to xt1x^{t-1} as wi(t1)w_i^{(t-1)},

the following equation holds: For each tt, v1(t)::vN(t)=w1(t1)::wN(t1).v_1^{(t)} : \dots : v_N^{(t)} = w_1^{(t-1)} : \dots : w_N^{(t-1)}. The likelihood of the ii-th predictor with respect to xt1x^{t-1} is calculated as wi(t1)=j=1t1Pi(j)(X=xj)w_i^{(t-1)} = \prod_{j=1}^{t-1} P_i^{(j)}(X = x_j), where we denote Pi(j)(X=xj)P_i^{(j)}(X = x_j) as Pi(j)(xj)P_i^{(j)}(x_j) and we set Pi(0)(x0)=1P_i^{(0)}(x_0) = 1 (i=1,,Ni = 1, \dots, N). In this setting, for each ii, show a relation between wi(t)w_i^{(t)} and wi(t1)w_i^{(t-1)}, and derive a formula for calculating vi(t+1)v_i^{(t+1)} using wi(t1)w_i^{(t-1)} and Pi(t)(xt)P_i^{(t)}(x_t) (i=1,,Ni = 1, \dots, N).

(2) Suppose that the senior predictor predicts the weather probability distribution sequentially with respect to tt for TT days. Then under the setting of vi(t)v_i^{(t)} as in (1), write an algorithm for the senior predictor to output a weather probability distribution and update the weights for predictors every day, and show the order of its computation time in terms of NN and TT. Here the initial weight for each predictor is set as follows: v1(0)==vN(0)=1/N.v_1^{(0)} = \dots = v_N^{(0)} = 1/N.

(3) When the prediction is sequentially made for TT days, we define the cumulative predictive loss for the senior predictor with respect to the sequence xT=x1xTx^T = x_1 \dots x_T of observed real coutcome as follows: Loss(xT)=t=1T(logP^(t)(xt)).Loss(x^T) = \sum_{t=1}^T \left( -\log \hat{P}^{(t)}(x_t) \right). Then write Loss(xT)Loss(x^T) as a function of Pi(t)(xt)P_i^{(t)}(x_t) (i=1,,N,t=1,,Ti = 1, \dots, N, t = 1, \dots, T) and NN. Here the logarithm is the natural logarithm.

(4) Prove that the senior predictor's cumulative loss for TT days defined in (3) is at most logN\log N larger than the least cumulative loss over all ii-th predictors for TT days. Here the cumulative loss for the ii-th predictor for TT days is defined as t=1T(logPi(t)(xt))\sum_{t=1}^T (-\log P_i^{(t)}(x_t)) (i=1,,Ni = 1, \dots, N).

题目描述

考虑一个在线天气预测系统:NN 名预测者每天各输出一次二元天气 X{1,0}X\in\{1,0\} 的概率分布,其中 1 表示晴、0 表示非晴,且假定不同日期的天气相互独立。第 ii 名预测者在第 tt 天输出 Pi(t)(X)P_i^{(t)}(X),对两个取值均有 0<Pi(t)(X)<10<P_i^{(t)}(X)<1

一名高级预测者汇总这 NN 个结果。第 tt 天给第 ii 人的权重为 vi(t)>0v_i^{(t)}>0,且 i=1Nvi(t)=1\sum_{i=1}^Nv_i^{(t)}=1,输出加权混合分布

P^(t)(X)=i=1Nvi(t)Pi(t)(X).\hat P^{(t)}(X)=\sum_{i=1}^Nv_i^{(t)}P_i^{(t)}(X).

高级预测者输出后,才公布当天真实结果 xt{1,0}x_t\in\{1,0\},上述过程随 tt 依次进行。

  1. 权重之比等于各预测者对过去 t1t-1 天结果序列 xt1=x1xt1x^{t-1}=x_1\cdots x_{t-1} 的似然之比:

    v1(t)::vN(t)=w1(t1)::wN(t1),v_1^{(t)}:\cdots:v_N^{(t)} =w_1^{(t-1)}:\cdots:w_N^{(t-1)},

    其中

    wi(t1)=j=1t1Pi(j)(X=xj),w_i^{(t-1)}=\prod_{j=1}^{t-1}P_i^{(j)}(X=x_j),

    简记 Pi(j)(X=xj)P_i^{(j)}(X=x_j)Pi(j)(xj)P_i^{(j)}(x_j),并令 Pi(0)(x0)=1P_i^{(0)}(x_0)=1。对每个 ii,写出 wi(t)w_i^{(t)}wi(t1)w_i^{(t-1)} 的关系,并推导用 wi(t1)w_i^{(t-1)}Pi(t)(xt)P_i^{(t)}(x_t) 计算 vi(t+1)v_i^{(t+1)} 的公式。

  2. 连续预测 TT 天,按第 1 问的权重规则写出高级预测者每天输出混合概率并更新各预测者权重的算法,分析关于 N,TN,T 的时间复杂度。初始权重均为

    v1(0)==vN(0)=1N.v_1^{(0)}=\cdots=v_N^{(0)}=\frac1N.
  3. 对真实序列 xT=x1xTx^T=x_1\cdots x_T,定义高级预测者的累计对数损失

    Loss(xT)=t=1TlogP^(t)(xt).Loss(x^T)=\sum_{t=1}^T-\log\hat P^{(t)}(x_t).

    用所有 Pi(t)(xt)P_i^{(t)}(x_t)i=1,,N; t=1,,Ti=1,\ldots,N;\ t=1,\ldots,T)及 NN 表示 Loss(xT)Loss(x^T),其中 log\log 为自然对数。

  4. ii 名预测者的 TT 日累计损失为

    t=1TlogPi(t)(xt).\sum_{t=1}^T-\log P_i^{(t)}(x_t).

    证明高级预测者的累计损失至多比所有单个预测者中最小的累计损失多 logN\log N

Kai

(1) Likelihood and weight updates

The empty-product likelihood is wi(0)=1w_i^{(0)}=1. Multiplying by the newly observed outcome probability gives

wi(t)=wi(t1)Pi(t)(xt).\boxed{w_i^{(t)}=w_i^{(t-1)}P_i^{(t)}(x_t).}

Weights proportional to the likelihoods must be normalized to sum to one. Thus

vi(t+1)=wi(t1)Pi(t)(xt)j=1Nwj(t1)Pj(t)(xt)=vi(t)Pi(t)(xt)P^(t)(xt).\boxed{v_i^{(t+1)}= \frac{w_i^{(t-1)}P_i^{(t)}(x_t)} {\sum_{j=1}^Nw_j^{(t-1)}P_j^{(t)}(x_t)} =\frac{v_i^{(t)}P_i^{(t)}(x_t)}{\hat P^{(t)}(x_t)}.}

All denominators are positive by the stipulated strictly positive probabilities.

(2) Sequential algorithm

Use the uniform weights for the first day's prediction. The statement calls the initial vector v(0)v^{(0)}; in the day-based notation of part (1), this is v(1)v^{(1)}, since it precedes any observation. It is the same uniform initialization, not an extra update using future data.

v[i] = 1/N for i = 1,...,N
for t = 1,...,T:
obtain today's N predictive distributions P[i]
prediction[0] = sum(v[i] * P[i][0] for i = 1,...,N)
prediction[1] = sum(v[i] * P[i][1] for i = 1,...,N)
output prediction
observe the actual outcome x[t]
z = prediction[x[t]]
for i = 1,...,N:
v[i] = v[i] * P[i][x[t]] / z

The senior predictor takes O(NT)\boxed{O(NT)} arithmetic operations and O(N)O(N) working storage, excluding the predictors' own computation and stored output history. It outputs before observing that day's outcome. For long sequences, store log-likelihoods and normalize using log-sum-exp to avoid numerical underflow from products of many small probabilities; this retains the same asymptotic arithmetic count.

(3) Cumulative loss

Write Wt=iwi(t)W_t=\sum_i w_i^{(t)}, so W0=NW_0=N. Then

P^(t)(xt)=iwi(t1)Pi(t)(xt)Wt1=WtWt1.\hat P^{(t)}(x_t)= \frac{\sum_iw_i^{(t-1)}P_i^{(t)}(x_t)}{W_{t-1}} =\frac{W_t}{W_{t-1}}.

Multiplying over days telescopes:

t=1TP^(t)(xt)=WTW0=1Ni=1Nt=1TPi(t)(xt).\prod_{t=1}^T\hat P^{(t)}(x_t)=\frac{W_T}{W_0} =\frac1N\sum_{i=1}^N\prod_{t=1}^TP_i^{(t)}(x_t).

Consequently

Loss(xT)=log(1Ni=1Nt=1TPi(t)(xt)).\boxed{Loss(x^T)=-\log\left(\frac1N\sum_{i=1}^N \prod_{t=1}^TP_i^{(t)}(x_t)\right).}

The uniform average is outside the products: this mixture selects one expert for the whole sequence in its likelihood representation, rather than selecting a fresh uniform expert each day.

(4) Bound relative to the best expert

Let Li=tlogPi(t)(xt)L_i=-\sum_t\log P_i^{(t)}(x_t) and choose iargminiLii_*\in\arg\min_iL_i. Since each likelihood is nonnegative,

1NieLi1NeLi.\frac1N\sum_i e^{-L_i}\ge\frac1N e^{-L_{i_*}}.

Applying the decreasing function log-\log gives

Loss(xT)Li+logN=miniLi+logN.\boxed{Loss(x^T)\le L_{i_*}+\log N=\min_i L_i+\log N.}

This is a bound for every realized sequence, not merely for an expected loss. Indeed the algebraic proof itself does not require stochastic independence of the daily outcomes. At N=1N=1 the two losses coincide; for N>1N>1 and finite TT, strict positivity makes the displayed upper bound strict, although it can be approached arbitrarily closely.