# Fitting of Tsallis function

**URL:** <https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207>\
**Category:** Newbie\
**Created:** [July 16, 2019, 6:11am UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207 "2019-07-16T06:11:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@Abh](https://root-forum.cern.ch/u/Abh)\
**Post date:** [July 16, 2019, 6:11am UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207/1 "2019-07-16T06:11:28Z")

</div>

Hi.  
I am facing problems with fitting the Levy-Tsallis function. I can’t set the power term(-n). Like here…

```auto
//Function 
  TF1 *LEVY=new TF1("LEVY","pow((x)*[0]*((([1]-1)*([1]-2))/(([1]*[2])*([1]*[2]+1.019*([1]-2))))*(1+((sqrt(x*x+(1.019*1.019)))-1.019)/([1]*[2])),-n)",0,3);
  LEVY->SetParameters(6,100,0.4);

```

This shows it is a zombie function.  
Can anybody help me??  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 16, 2019, 6:43am UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207/3 "2019-07-16T06:43:13Z")

</div>

You can use an additional parameter for “n” (see [TF1::FixParameter](https://root.cern.ch/doc/master/classTF1.html#ae8869189ca9a2affe690fe26dcaa6c8c)) or you must “hard-code” its value in the definition.

---

<div class="post-metadata">

**Author:** ![Abh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@Abh](https://root-forum.cern.ch/u/Abh)\
**Post date:** [July 16, 2019, 6:45am UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207/4 "2019-07-16T06:45:26Z")

</div>

Thanks but this n is the parameter [1] I have used before in the formula.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 16, 2019, 6:47am UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207/5 "2019-07-16T06:47:02Z")

</div>

so, you should simply write `-[1]` instead of `-n`.

---

<div class="post-metadata">

**Author:** ![Abh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@Abh](https://root-forum.cern.ch/u/Abh)\
**Post date:** [July 16, 2019, 4:55pm UTC](https://root-forum.cern.ch/t/fitting-of-tsallis-function/35207/6 "2019-07-16T16:55:54Z")

</div>

Yes. Its done. Thank you.
