# Estimating parameters of Virial equation using Ordinary Least Squares

I tried to estimate the positive parameters $$B$$ and $$C$$ of the Virial equation $$pV=\bar{n}(RT+Bp+Cp^2)$$, where $$\bar{n}=0.25, \, T=300, \, R=8.314$$ with the data

\begin{align} p &= (50,60,\dots,190,200) \\ V&=(12.423,10.3262,8.9823,7.7521,6.9289,6.1724,5.6632,5.0086,\\ &\quad\quad4.7436,4.3807,4.1104,3.9014,3.666,3.6048,3.2663,3.1232) \end{align}

using Ordinary Least Squares (OLS).

For that I first manipulated the equation to get $$\tilde{V}=B + C p$$ where $$\tilde{V}=\frac{V}{\bar{n}}-\frac{R}{Tp}$$. With this, we can write down a linear model

$$y = A \theta + n$$

where $$A$$ is the matrix of regressors, $$\theta=(B,C)$$ and some noise term $$n$$. The obtained results via OLS ($$\theta = (A^\top A)^{-1}A^\top y$$) are approximately $$B=-0.285$$, $$C=0.0015$$. As stated earlier, both $$B, C$$ have to be positive, so this result makes no sense. I also estimated the variance of the noise using the formula

$$\sigma_n^2 = \frac{1}{(N-2)} e^\top e \, ,$$

where $$N$$ is the number of data points and $$e=y-A\theta$$ is the residual vector, which results in $$\sigma_n^2=0.00465$$.

Now, my questions are:

1.) I figured out that for the given data, changes in $$B$$ have a much smaller impact than changes in $$C$$. Is there a way to describe this mathematically?

2.) In my opinion $$\sigma_n$$ is pretty small but the results are nonsense from a physical point of view. Is there anything in the data/equation that alerts you that the results are probably not accurate?

3.) Is there an (obvious) way to improve the estimate?

• Please pay attention to the significance of the estimates. If you do your fitting correctly, it should show that only the intercept is significant. That is, a formula of the form $V = \hat\alpha/p$ fits the data well where (evidently) $\hat\alpha$ estimates $\bar{n}RT.$ The residuals of such a model (which I estimated from $Vp$ using weighted least squares) have essentially the same variance you report for your fit, suggesting the two models are close.
– whuber
May 1, 2020 at 17:39
• @whuber Sorry if misunderstand your comment but are you suggesting that I forget about $B$ and $C$ and should instead try to estimate the intercept? Would you mind explaining what you mean by the significance of the estimates? May 2, 2020 at 20:29