Constructing confidence intervals for predictive model I'm constructing a model to predict the weight of a species of insect given a set of other variables. The plot below shows the performance of my model using a set of test data where the true weight of the insects is known. The x-axis is the true weight of the insect and the y-value is the associated error of my model—the absolute value of the predicted weight - true weight:

From this visual, you can see that I have many insects with relatively low weights. In these cases, my model has a relatively lower predictive error. In contrast, I have relatively few insects which are heavy and the error associated with these predictions displays much more variance along with higher error.
Given this model and the test data, I'd like to find a way to construct confidence intervals for new predictions. For example, if my model predicts a given insect is relatively heavy, the confidence intervals around this prediction would be large. My questions is, how can I do this? A linear model seems inappropriate for this data since most of the points are clustered near the origin. I'm at a loss for how I can construct confidence intervals for my predictions.
 A: Bootstrap sample your training data many times (let's say, N times) and train a model from each bootstrapped sample (giving N models). Calculate a prediction on your test set using each model (giving N predictions for each point in your test set). This will allow you to calculate a confidence band for each test point's prediction. For plotting purposes, you may find it useful to fit a LOESS curve (or some other type of smoothing method) to the plot of insect size vs. CI for each element of your test set, giving an estimated mean confidence as a function of insect size.
A: There is no exact detail here on what model you used, but you are right in suspecting linear models for this kind of application. 
The most appropriate kind of model is likely to be a generalised linear model with logarithmic link which will ensure that positive weight is predicted, even for very small insects, a desideratum here. Even with logarithmic link, error in the first instance means observed weight $-$ predicted weight. 
You should indicate what software you are using so that people who also use it can tune in and indicate precisely which functions or commands or routines might help. 
