# Scale and Location to TDist in Distributions

**URL:** <https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360>\
**Category:** Statistics\
**Tags:** distributions\
**Created:** [January 10, 2022, 8:53pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360 "2022-01-10T20:53:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominic\_Pazzula](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dominic_pazzula/32/12783_2.png) [@Dominic\_Pazzula](https://discourse.julialang.org/u/Dominic_Pazzula)\
**Post date:** [January 10, 2022, 8:53pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/1 "2022-01-10T20:53:45Z")

</div>

Is there any reason not to have a scale and location parameter in TDist in the Distributions package? I was trying to do a MLE with a Generalized T distribution when I realized it wasn’t available out of the box.

Not hard to code up on my own, just curious if it wasn’t in there for a reason.

---

<div class="post-metadata">

**Author:** ![matvil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matvil/32/15727_2.png) [@matvil](https://discourse.julialang.org/u/matvil)\
**Post date:** [January 16, 2022, 3:35pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/2 "2022-01-16T15:35:59Z")

</div>

I believe the idea is that location-scale distributions are better defined using the primitive standardized distribution and the `LocationScale` function. Like this:

`TDist(μ, σ, ν) = LocationScale(μ, σ, TDist(ν))`

---

<div class="post-metadata">

**Author:** ![Dominic\_Pazzula](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dominic_pazzula/32/12783_2.png) [@Dominic\_Pazzula](https://discourse.julialang.org/u/Dominic_Pazzula)\
**Post date:** [January 16, 2022, 5:46pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/3 "2022-01-16T17:46:39Z")

</div>

Thanks. I had not actually seen that. I will give it a shot.

---

<div class="post-metadata">

**Author:** ![DoktorMike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/doktormike/32/2736_2.png) [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Post date:** [January 16, 2022, 6:22pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/4 "2022-01-16T18:22:07Z")

</div>

In my opinion this should definitely be part of the distributons package. I spent a good hour searching through the documentation and didn’t figure this out. 😂

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [January 18, 2022, 8:01am UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/5 "2022-01-18T08:01:05Z")

</div>

After seeing this post, I went on to make [this PR](https://github.com/JuliaStats/Distributions.jl/pull/1482#discussion_r786065465) to improve documentation.

And it turns out that one should use `*` to scale and `+` to shift distributions - `LocationScale` is on it’s way out. Follow the effort to create good documentation over at the PR.

---

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [May 30, 2022, 11:17am UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/6 "2022-05-30T11:17:19Z")

</div>

Sorry if I’m being dim. But how do we then define TDist in terms of it’s location and scale? We still need to supply 3 parameters here.

---

<div class="post-metadata">

**Author:** ![matvil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matvil/32/15727_2.png) [@matvil](https://discourse.julialang.org/u/matvil)\
**Post date:** [May 30, 2022, 12:06pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/7 "2022-05-30T12:06:13Z")

</div>

Since LocationScale is now deprecated, I now use:

`TDist(μ, σ, ν) = μ + TDist(ν)*σ`

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [May 30, 2022, 1:00pm UTC](https://discourse.julialang.org/t/scale-and-location-to-tdist-in-distributions/74360/8 "2022-05-30T13:00:35Z")

</div>

> [@matvil](#):
>
> TDist(μ, σ, ν) = μ + TDist(ν)\*σ

Thainks for the quick reply! Yes, that’s helpful thanks.
