combining data from two different types of sensor with different reliability I'm trying to measure distance using two types of sensors: ultrasonic and camera. 
I've found a way to calculate the distance using those two sensors and now I need to combine the data in the hope of outputting better measurement. 
How do you combine these two data knowing that one is more reliable than the other (judging from the error of measurement)? 
I was thinking of just using the weighted average method, but how do you find the weight for each of those sensors? 
Other better methods of fusing the data are also welcomed!
 A: Instead of combining the data, you may combine your distance estimators(the method you calculate the distance from each data set) with a suitable weight. The weight can be calculated by using a method such as stacking.  To use stacking, you need data for the true distance though. I may give you a link to a paper explaining the stacking: https://link.springer.com/article/10.1007%2FBF00117832

Let me first explain my understanding on what you are trying to do. You want to find the sample weight to calculate distance. The problem corresponds to this: 
$$
\widetilde{d} = \hat{D}(w_1 X_1 + w_2 X_2)
$$
where $\widetilde{d}$: distance estimate, 
$X_1$ and $X_2$: two data sets from two sensors, 
$w_1$ and $w_2$: weights of data,
$\hat{D}$: estimator of distance.
To decide the weights, $w_1$ and $w_2$, you will minimize error $(d-\widetilde{d})^2$ over your data ($d$ is the true distance). This is an ordinary Machine Learning process. And during the fitting process, you will decide the functional form of $\hat{D}$.
But the fitted form of $\hat{D}$ might be quite different from your current distance calculation method and so it will lose the theoretical justification and interpretability. To be worse, the resulting estimator might not be robust.
With the stacking method, you just need to find out two weights:
$$
\widetilde{d} = w_1 \hat{D_1}( X_1) + w_2 \hat{D_2} (X_2)
$$ 
You already know $\hat{D_1}$ and $\hat{D_2}$ which are your current distance calculation methods.
Because of this, your problem gets simpler like this: 
$$
\widetilde{d} = w_1 \widetilde{X_1} + w_2 \widetilde{X_2}
$$ 
The sensor data are transformed into $\widetilde{X_1}$ and $\widetilde{X_2}$ by the distance functions. Calculating $w_1$ and $w_2$ is a linear regression problem. (This is a sketch of stacking. Read the paper for more details.)
With the stacking method, you can use your current distance calculation methods which I assume you have a theoretical background and I guess it would be more robust. 
