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 humidity `

for a=0:0.01:2.3 for ab=0:0.001:0.0150 estrh=10.^(a-(ab.*t)); % statistical method to estimate relative humidity

difference=estrh-hum; difference_sq=difference.^2; sum_difference=sum(difference_sq); if sum_difference<best_total_dist best_total_dist=sum_difference; best_a=a; best_ab=ab; end endend

Where am I going wrong?

## Best Answer