how to make a random t-distribution sample?

12 views (last 30 days)
nanakim
nanakim on 8 Nov 2022
Answered: Star Strider on 8 Nov 2022
Hi!
I'd like to make a t-distribution.
so I made chi square distribution using random('norm')
the degree of freedom is 5
and I also obtain zvalue using zscore function.
(I made standard normal distribution first and used this distribution for zscore)
and using sqrt.
finally, I tried zvalue(=zscore) divided by sqrt(chi/degree of freedom)
but matlab said the matrix dimensions do not agree.
so what can I do? to make t-distribution?
how can I get a ..z score and how can I divide it by sqrt(chi/degree of freedom)?
thank you so much!

Answers (1)

Star Strider
Star Strider on 8 Nov 2022
Use the trnd function.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!