Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Adapting histfit.m to tfit.m

Subject: Adapting histfit.m to tfit.m

From: Tava Eurdanceza

Date: 17 Mar, 2010 01:45:10

Message: 1 of 7

Hello
I want to know how Adapting histfit.m to tfit.m?
I want to fitting my data using pdf t distribution
Thanks before

Subject: Adapting histfit.m to tfit.m

From: Wayne King

Date: 17 Mar, 2010 08:22:02

Message: 2 of 7

"Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hnpc76$op8$1@fred.mathworks.com>...
> Hello
> I want to know how Adapting histfit.m to tfit.m?
> I want to fitting my data using pdf t distribution
> Thanks before

Hi Tava, histfit() already supports the t distribution. You can use the 'tlocationscale' option in histfit.

R = trnd(4,400,1);
histfit(R,15,'tlocationscale')

Hope that helps,
Wayne

Subject: Adapting histfit.m to tfit.m

From: Tava Eurdanceza

Date: 7 Apr, 2010 03:00:23

Message: 3 of 7

"Wayne King" <wmkingty@gmail.com> wrote in message <hnq3fa$i3n$1@fred.mathworks.com>...
> "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hnpc76$op8$1@fred.mathworks.com>...
> > Hello
> > I want to know how Adapting histfit.m to tfit.m?
> > I want to fitting my data using pdf t distribution
> > Thanks before
>
> Hi Tava, histfit() already supports the t distribution. You can use the 'tlocationscale' option in histfit.
>
> R = trnd(4,400,1);
> histfit(R,15,'tlocationscale')
>
> Hope that helps,
> Wayne


Thanks for your answer Sir. But what the mean about 15 in histfit(R,15,'tlocationscale')?

Subject: Adapting histfit.m to tfit.m

From: Wayne King

Date: 7 Apr, 2010 10:02:04

Message: 4 of 7

"Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hpgsg7$ck8$1@fred.mathworks.com>...
> "Wayne King" <wmkingty@gmail.com> wrote in message <hnq3fa$i3n$1@fred.mathworks.com>...
> > "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hnpc76$op8$1@fred.mathworks.com>...
> > > Hello
> > > I want to know how Adapting histfit.m to tfit.m?
> > > I want to fitting my data using pdf t distribution
> > > Thanks before
> >
> > Hi Tava, histfit() already supports the t distribution. You can use the 'tlocationscale' option in histfit.
> >
> > R = trnd(4,400,1);
> > histfit(R,15,'tlocationscale')
> >
> > Hope that helps,
> > Wayne
>
>
> Thanks for your answer Sir. But what the mean about 15 in histfit(R,15,'tlocationscale')?


Hi Tava, 15 is the number of bins used in constructing the histogram, see

>>doc histfit

Wayne

Subject: Adapting histfit.m to tfit.m

From: Tava Eurdanceza

Date: 9 Apr, 2010 01:54:08

Message: 5 of 7

"Wayne King" <wmkingty@gmail.com> wrote in message <hphl6s$rei$1@fred.mathworks.com>...
> "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hpgsg7$ck8$1@fred.mathworks.com>...
> > "Wayne King" <wmkingty@gmail.com> wrote in message <hnq3fa$i3n$1@fred.mathworks.com>...
> > > "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hnpc76$op8$1@fred.mathworks.com>...
> > > > Hello
> > > > I want to know how Adapting histfit.m to tfit.m?
> > > > I want to fitting my data using pdf t distribution
> > > > Thanks before
> > >
> > > Hi Tava, histfit() already supports the t distribution. You can use the 'tlocationscale' option in histfit.
> > >
> > > R = trnd(4,400,1);
> > > histfit(R,15,'tlocationscale')
> > >
> > > Hope that helps,
> > > Wayne
> >
> >
> > Thanks for your answer Sir. But what the mean about 15 in histfit(R,15,'tlocationscale')?
>
>
> Hi Tava, 15 is the number of bins used in constructing the histogram, see
>
> >>doc histfit
>
> Wayne

oh..i see. Thanks so much Sir. But can we not use the number of bins? In order for the number of bins is determined automatically by matlab

Tava

Subject: Adapting histfit.m to tfit.m

From: Wayne King

Date: 9 Apr, 2010 10:17:23

Message: 6 of 7

"Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hpm1c0$cga$1@fred.mathworks.com>...
> "Wayne King" <wmkingty@gmail.com> wrote in message <hphl6s$rei$1@fred.mathworks.com>...
> > "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hpgsg7$ck8$1@fred.mathworks.com>...
> > > "Wayne King" <wmkingty@gmail.com> wrote in message <hnq3fa$i3n$1@fred.mathworks.com>...
> > > > "Tava Eurdanceza" <tava_cute@yahoo.com> wrote in message <hnpc76$op8$1@fred.mathworks.com>...
> > > > > Hello
> > > > > I want to know how Adapting histfit.m to tfit.m?
> > > > > I want to fitting my data using pdf t distribution
> > > > > Thanks before
> > > >
> > > > Hi Tava, histfit() already supports the t distribution. You can use the 'tlocationscale' option in histfit.
> > > >
> > > > R = trnd(4,400,1);
> > > > histfit(R,15,'tlocationscale')
> > > >
> > > > Hope that helps,
> > > > Wayne
> > >
> > >
> > > Thanks for your answer Sir. But what the mean about 15 in histfit(R,15,'tlocationscale')?
> >
> >
> > Hi Tava, 15 is the number of bins used in constructing the histogram, see
> >
> > >>doc histfit
> >
> > Wayne
>
> oh..i see. Thanks so much Sir. But can we not use the number of bins? In order for the number of bins is determined automatically by matlab
>
> Tava

Hi Tava, yes, please see the documentation for histfit()

>>doc histfit



 R = trnd(2,500,1);
 histfit(R,[],'tlocationscale');

Wayne

Subject: Adapting histfit.m to tfit.m

From: Chao Lin

Date: 10 Nov, 2010 17:04:03

Message: 7 of 7

Dear Wayne,

 When I tried to fit a set of data by using histfit(data, [], 'tlocationscale'), I got a Warning: Maximum likelihood estimation did not converge. Iteration limit exceeded.
The normal distribution might provide a better fit.

Does it mean my data set is not t distributed and Matlab will give out a Gaussian fit instead?

Thank you!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us