Can pinball loss be used to construct a prediction interval? I'm modeling some time series data ($\{y_t\}_t$) and would like to construct a model that is able to return not just a single-value prediction $\hat{y_t}$, but an interval $C_t=(\hat{y}_{t, lower}, \hat{y}_{t, upper})$ such that $y_t \in C_t$ with some probability.

Now, I've learned about the pinball loss:
$$L(q, z)=\cases{qz, &amp; z &gt;= 0 \\ (q-1)z,&amp; z&lt;0}$$
If I understand it correct, $q \in (0,1)$ is the quantile that I want to predict, and $z$ is the difference between the actual value $y$ and what my model predicted $\hat{y}$. If the model is trained to optimize this loss for some $q$, it will return me the estimate $\hat{y}^{(q)}_t$ such that $P(y_t &lt; \hat{y}^{(q)}_t)=q$. Is this interpretation correct?

Then, can I simply train two models, say one for $q=0.05$ and the other for $q=0.95$ in order to get the estimates of the intervals that contain the actual values with the probability $0.95-0.05=0.9$?
Yes, your interpretation regarding the pinball loss function seems right. For a given quantile value t between 0 and 1, it gives you the threshold value v. 


  Then, can I simply train two models, say one for q=0.05 and the other for q=0.95 in order to get the estimates of the intervals that contain the actual values with the probability 0.95−0.05=0.9?
  `


And of course if you had trained two models to give threshold values for two quantiles, you can say that  $p(\hat{y}_{t, lower} \le y_t &lt; \hat{y}_{t, upper}) = |\delta(q_1-q_2)|$