# Calculate optimal spacing for magnetic field measurement using Gaussian Multivariate likelihood distribution

I posted this question on Physics exchange as well, but is rather mathematic :)

I have a vertical magnetometer configuration, and measure lines on the ground. I want to calculate the optimal spacing, based on the interpolation between the lines. Applying the generalized multivariate Gaussian likelihood function:

$$L(B_m, B_t, P)=\exp\left(-\frac12[B_m-B_t]P^{-{1}} [B_m-B_t]^T\right)$$

$$B_m$$ is the measured vector with $$B_x$$, $$B_y$$, and $$B_z$$ components, $$B_t$$ the respective interpolated values, $$P$$ the covariance matrix. This was originally used as a probability criteria for assigning a location to a magnetic map. Let's denote that probability as confidence score. On 1D, if we only have two measured points on the edge, should I then measure the Magnetic field and create a Graph p(x) and fit it with a function similar to the one above, also Gaussian. Is it sufficient if I assume:

$$p(x)=\exp(-a(x-d)^2)+\exp(-a(x+d)^2)$$

and fit it to the measured probability distribution? Of course some values will have to be dropped, because they statistically are quite near the real ones, thus close to 1, Or would I need a covariance matrix as well, and not simply be allowed to see it in 1d?

I appreciate any help! If my approach is false, be free to tell me, looking forward to new ways how to handle this!