Fit with a special function

Hi everybody

I really need help

I want to fit some data points with a function defined by

Double_t mDM(float x, Double_t *par)
    Double_t value = -(TMath::Power(par[0],par[4])*TMath::Power(TMath::Power(x,-par[2]),(-3 + par[4])/par[2])*par[1]*ROOT::Math::hyperg((3 - par[4])/par[2], (par[3] - par[4])/par[2], (3. + par[2] - par[4])/par[2], -TMath::Power((x/par[0]),par[2])))/(-3. + par[4]);
    return value;

but I get many errors with the definition of the hypergeometric function.

I will really appreciate your help.


Can you provide a small macro using this function ?


I resolve my problem using

Double_t hyperg(Double_t *par,float x){
    Double_t par1[2]={par[0], par[2]};
    Double_t value2 = gsl_sf_hyperg_2F1((3 - par[4])/par[2], (par[3] - par[4])/par[2], (3. + par[2] - par[4])/par[2], -temp1(x,par1));
    return value2;

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.