I have observed relative humidity and a statistical method to estimate RH. The statistical method uses two different parameters and I would like to use the observations to parametrize the two parameters (the parameters are supposed to be around 2.1 for a and 0.130 for ab).
What I have done so far is;
best_total_dist=10000000000;best_a=100;best_ab=100;hum=log(rh); % rh is observed relative humidityfor a=0:0.01:2.3for ab=0:0.001:0.0150estrh=10.^(a-(ab.*t)); % statistical method to estimate relative humiditydifference=estrh-hum;difference_sq=difference.^2;sum_difference=sum(difference_sq);if sum_difference<best_total_distbest_total_dist=sum_difference;best_a=a;best_ab=ab;endendend
Where am I going wrong?