# Predicting the Variance of the Residuals

Regression is the task of modeling the response $$r$$ to the exploratory set of variables $$X$$ such that:

$$r=f(X)+ \epsilon$$

Assume the regression function $$f(X)$$ is already known, and for any future sample $$X^t$$:

$$f(X^t)=\bar{r}^t$$

Where $$\bar{r}$$ is always measurable in the sample data. What I would like to model is the noise term that represents the residual of any data point.

$$r= \bar{r} + \epsilon(X')$$

$$r-\bar{r}=\epsilon(X')$$

If we make the assumption that $$\bar{r}$$ is an unbiased estimator of $$r$$, then the error can be summarized as:

$$\epsilon(X') \sim \mathfrak{N}(0,\sigma^2)$$

In words what I am trying to do is quite simple: Given a model, describe the noise ($$\sigma^2$$) of the model as it relates to a set of variables $$X'$$. i.e. some variables produce noise with higher variance from the model than others, but all noise is normally distributed.

I am at a complete loss as to how to describe this type of problem. I suppose you could say the difference between what I am trying to do and typical linear regression would be that I am trying to correlate a set of variables $$X'$$ with a stochastic model for noise, instead of with a scalar prediction.

If someone could point me in the direction of a proper formulation for what I am attempting to describe, or techniques to look at for solving this type of problem, I would highly appreciate it. I am fairly new to ML and statistics, I apologize for the poor/incorrect formulation.