Dear Experts,
I have a function y = f(x,a,b) with known a and b parameters. I would like to calculate the uncertainty of the function. To do that I have to calculate the derivative of f as a function of a and b. In this case, dy should be: dy = sqrt(((df/da)^2 * da^2 + (df/db)^2 * db^2 + (df/da)(df/db)dadb).
I have the covariance matrix of da^2, db^2 and dadb as:
conv= [a2, ab, b2 ] = [0.0009778, 0.009128, 1.016]
I couldn’t find any example showing how I can do that. I found some example suggest to use:
void GradientPar(const Double_t *x, Double_t *grad, Double_t eps)
But I don’t understand how I should use it and how I can provide the covariance matrix
Can you help me by showing some examples
Here is my function:
float * GEnFunction(float GEn_arr[], int length){
Double_t a = 3.1320, b = 2.97626;
Double_t mass=0.93957, lambda2=0.71;
for (int i = 0; i < length; ++i){
Double_t tau = q2_bin[i]/(4*pow(mass,2.0));
Double_t GD = 1.0/pow(1 + (q2_bin[i]/lambda2),2.0);
GEn_arr[i] =(a*tau/(1 + (b*tau)))/GD;
}
return GEn_arr;
}
and the Covariance matrix:
conv= [a2, ab, b2 ] = [0.0009778, 0.009128, 1.016]
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided