How can I estimate parameters of the student's t distribution in a loop?

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

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?
mean, standard deviation and degrees of freedom
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.
my apologies if I'm not being clear enough. I'm not very familiar with matlab - basically I'm trying to compute the following
fitdist(uu1','tlocationscale')
x1=icdf('t',uu1,nu,mu,sigma)
Matlab returns this
ans =
tlocationscale distribution
mu = 0.527668
sigma = 0.290663
nu = 9.58997e+006
??? Undefined function or variable 'nu'.
Which is what I meant by matlab doesn't let me 'call' the parameters. I cant just copy and paste the values in the formula of x1 as I need to do this multiple times (in a loop - uu1 in a random generated vector)
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.

Sign in to comment.

Answers (1)

The returned distribution object (structure) has fields mu and sigma

Asked:

May
on 3 Mar 2014

Commented:

May
on 3 Mar 2014

Community Treasure Hunt

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

Start Hunting!