Overfitting 和 Underfitting 的概念大家都很熟悉,就不赘述了。

评估模型好坏

Cross Validation

test the model’s predictive accuracy on a small part of the sample.

PSIS(Pareto-smoothed cross-validation)

lppd(log-pointwise-predictive-density)

信息量准则(information criteria)

likelihood-based measures of model fit that include a penalty for complexity.

AIC、WAIC 等都是信息量准则的例子。

防止 Overfitting 的手段

regularizing prior

简单来说就是选择更“紧”的 prior。

Multilevel model

有时数据中可以显现出一些明显的分组(cluster)。使用 Multilevel model 可以更好地处理这种情况,防止由于重复采样、不均衡采样导致的 underfit 或 overfit 问题,同时能更好的捕捉组间、组内的差异。

例子

比如关于蝌蚪死亡率的模型:

SiBinomial(Ni,pi)logit(pi)=αTank[i]αiNormal(0,1.5)

我们可以将这个模型“升级”为 Multilevel model:

SiBinomial(Ni,pi)logit(pi)=αTank[i]αiNormal(α,σ)αNormal(0,1.5)σExp(1)

相比于针对每个 Tank 估计一个完全无关 α,这个新模型限制了 α 的分布,使得 α 之间的差异更小,同时也更好地捕捉了 α 的分布。

shrinkage

Multilevel model 的一个重要特性是 shrinkage。

对于每个组,我们都会估计一个 α,这些 α 都遵循以 α 为均值的正态分布。

如果某个组的数据很少,因为这个组的数据对 α 的估计相对不是很可靠,这个组的 α 会更接近利用 α 计算出的值。

如果某个组的数据很多,因为这个组的数据对 α 的估计相对可靠,这个组的 α 会更接近利用这个组的数据计算出的值。

但无论如何,所有使用含 α 的 multilevel 模型做出的估计都会比原模型更接近直接 α 代替 α 的估计,这个效应称为 shrinkage。

Pooling

  • Complete pooling. This means we assume that the population of clusters is invariant, the same as estimating a common intercept for all clusters.
  • No pooling. This means we assume that each cluster tells us nothing about any other cluster.
  • Partial pooling. This means using an adaptive regularizing prior.

一般来说使用 Multilevel model 就是采用了 partial pooling。

Varying effects

varying intercepts: For each cluster in the data, we use a unique intercept parameter. eg. liveness of tadpoles in different tanks

varying slope: For each cluster in the data, we use a unique slope parameter. eg. busy/unbusy café -> waitime