How can I estimate parameters of the student's t distribution in a loop?
Show older comments
I have a loop which generates several random numbers, each time I have to estimate their parameters using the univariate Student's t and then use the estimated parameters later on. Is there any way I can do this? fitdist lets me estimate them however it doesn't seem to let me 'call' them so I cannot use them later on in the mfile.
6 Comments
Star Strider
on 3 Mar 2014
What parameters do you want to estimate for the random vector generated by each iteration of the loop? Mean and standard deviation? T-statistic and degrees of freedom for each element in the vector? Confidence interval for the the vector? Something else?
May
on 3 Mar 2014
dpb
on 3 Mar 2014
Well, now are you talking about the parameters of the fitted t or those of the random sample?
As noted in my answer, the fit results are in the named structure fields mu and sigma returned by fitdist; the DOF is simple to compute given there are two estimated parameters.
May
on 3 Mar 2014
dpb
on 3 Mar 2014
x1 is a structure whose field names are mu, sigma, nu.
To reference them, it's
x1.mu
etc. Read in the doc of "data Types" for more details of Matlab.
May
on 3 Mar 2014
Answers (1)
dpb
on 3 Mar 2014
0 votes
The returned distribution object (structure) has fields mu and sigma
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!