# Estimation of covariance over a range of independent variable

I have a set of data that comprise 2 dependent variables (let's call them $$x_1$$ and $$x_2$$) evaluated at different temperatures, T.

There is an assumption that for a range of T ($$T_0) there is a linear covariance between $$x_1$$ and $$x_2$$, where $$T_1$$ and $$T_0$$ are unknown. The prior assumption is that the larger the range in $$x_1$$ and $$x_2$$ that the chosen $$T_0$$ and $$T_1$$ give, the better (i.e. there is a tradeoff between misfit from a linear covariance, and length of the line).

I want to use a bayesian method to look at the range of permissible linear fits to a set of data. The slope of the line (when $$x_1$$ is plotted against $$x_2$$) is the parameter of interest, and so for experiments that deviate strongly from a single linear trend, the range of uncertainty on this parameter should be much higher.

I'm struggling to parameterize this, as I've never seen an example of this type of problem (where only part of the data may be used) before.

https://bayes.wustl.edu/etj/articles/leapz.pdf (equation 51) gives the likelihood function for the case where all the data are used for a linear fit, but this model performs poorly in many cases and underestimates the uncertainty on the slope parameter for nonlinear data (with these data often being biased). Does anybody have an example of a problem like this in bayesian statistics or have any thoughts on parameterizing this problem?