Distribution Fitting with R

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Distribution Fitting with R

PaulJr
Hello everyone,

Basically, I want to perform some distribution fitting analysis to a
particular data that I have.

So the data I will be working with is structured as follows:

*Vessel Size*                           *   Number of Vessels*
         *Frequency*

1000-2000 TEUS                                           1000
                      1%
2000-3000 TEUS                                           3000
                    15%
3000-4000 TEUS                                           2750
                    10%
4000-5000 TEUS                                           5700
                    30%


The field Vessel Size is a categorical one, specifying what is the vessel
size category, then the field Number of Vessels tells me how many vessels
are in each one of those vessel size categories and frequency is just the
percentage of the total (this is just an example).

How can I perform a distribution fit for this data? The reason why I want
to fit a distribution is to then perform a Monte Carlo Simulation with the
data.

Any help will be greatly appreciated,

Best regards,

Paul

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Distribution Fitting with R

Bert Gunter
Just sample with replacement from your empirical distribution? See:

?sample ## note the "replace" argument

Other than that, I do not understand what you mean by "distribution
fitting analysis."

Cheers,
Bert

On Mon, Aug 5, 2013 at 10:55 AM, Paul Bernal <[hidden email]> wrote:

> Hello everyone,
>
> Basically, I want to perform some distribution fitting analysis to a
> particular data that I have.
>
> So the data I will be working with is structured as follows:
>
> *Vessel Size*                           *   Number of Vessels*
>          *Frequency*
>
> 1000-2000 TEUS                                           1000
>                       1%
> 2000-3000 TEUS                                           3000
>                     15%
> 3000-4000 TEUS                                           2750
>                     10%
> 4000-5000 TEUS                                           5700
>                     30%
>
>
> The field Vessel Size is a categorical one, specifying what is the vessel
> size category, then the field Number of Vessels tells me how many vessels
> are in each one of those vessel size categories and frequency is just the
> percentage of the total (this is just an example).
>
> How can I perform a distribution fit for this data? The reason why I want
> to fit a distribution is to then perform a Monte Carlo Simulation with the
> data.
>
> Any help will be greatly appreciated,
>
> Best regards,
>
> Paul
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Distribution Fitting with R

PaulJr
Hello Bert,

Thank you for your comments. I want to actually fit a formal statistical
distribution to my data using the classical methodologies (either Shapiro
Wilk, Anderson Darling, Chi-Square, etc.). Once I have fitted a
distribution then I will start generating random numbers and performing the
Monte Carlo Simulation.

That is the reason why!!

Best regards,

Paul


2013/8/5 Bert Gunter <[hidden email]>

> Just sample with replacement from your empirical distribution? See:
>
> ?sample ## note the "replace" argument
>
> Other than that, I do not understand what you mean by "distribution
> fitting analysis."
>
> Cheers,
> Bert
>
> On Mon, Aug 5, 2013 at 10:55 AM, Paul Bernal <[hidden email]>
> wrote:
> > Hello everyone,
> >
> > Basically, I want to perform some distribution fitting analysis to a
> > particular data that I have.
> >
> > So the data I will be working with is structured as follows:
> >
> > *Vessel Size*                           *   Number of Vessels*
> >          *Frequency*
> >
> > 1000-2000 TEUS                                           1000
> >                       1%
> > 2000-3000 TEUS                                           3000
> >                     15%
> > 3000-4000 TEUS                                           2750
> >                     10%
> > 4000-5000 TEUS                                           5700
> >                     30%
> >
> >
> > The field Vessel Size is a categorical one, specifying what is the vessel
> > size category, then the field Number of Vessels tells me how many vessels
> > are in each one of those vessel size categories and frequency is just the
> > percentage of the total (this is just an example).
> >
> > How can I perform a distribution fit for this data? The reason why I want
> > to fit a distribution is to then perform a Monte Carlo Simulation with
> the
> > data.
> >
> > Any help will be greatly appreciated,
> >
> > Best regards,
> >
> > Paul
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> Internal Contact Info:
> Phone: 467-7374
> Website:
>
> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Distribution Fitting with R

David Carlson
Try fitdistr in package MASS or fitdist in package
fitdistrplus or goodfit in package vcd.

Also

?shapiro.test
?ad.test
?chisq.test

There is also Vito Ricci's "Fitting Distributions with R" in
the contributed documentation for R at

http://cran.r-project.org/doc/contrib/Ricci-distributions-en.p
df

------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77840-4352


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Paul Bernal
Sent: Monday, August 5, 2013 1:11 PM
To: Bert Gunter
Cc: [hidden email]
Subject: Re: [R] Distribution Fitting with R

Hello Bert,

Thank you for your comments. I want to actually fit a formal
statistical
distribution to my data using the classical methodologies
(either Shapiro
Wilk, Anderson Darling, Chi-Square, etc.). Once I have fitted
a
distribution then I will start generating random numbers and
performing the
Monte Carlo Simulation.

That is the reason why!!

Best regards,

Paul


2013/8/5 Bert Gunter <[hidden email]>

> Just sample with replacement from your empirical
distribution? See:
>
> ?sample ## note the "replace" argument
>
> Other than that, I do not understand what you mean by
"distribution
> fitting analysis."
>
> Cheers,
> Bert
>
> On Mon, Aug 5, 2013 at 10:55 AM, Paul Bernal
<[hidden email]>
> wrote:
> > Hello everyone,
> >
> > Basically, I want to perform some distribution fitting
analysis to a
> > particular data that I have.
> >
> > So the data I will be working with is structured as
follows:
> >
> > *Vessel Size*                           *   Number of
Vessels*
> >          *Frequency*
> >
> > 1000-2000 TEUS
1000
> >                       1%
> > 2000-3000 TEUS
3000
> >                     15%
> > 3000-4000 TEUS
2750
> >                     10%
> > 4000-5000 TEUS
5700
> >                     30%
> >
> >
> > The field Vessel Size is a categorical one, specifying
what is the vessel
> > size category, then the field Number of Vessels tells me
how many vessels
> > are in each one of those vessel size categories and
frequency is just the
> > percentage of the total (this is just an example).
> >
> > How can I perform a distribution fit for this data? The
reason why I want
> > to fit a distribution is to then perform a Monte Carlo
Simulation with

> the
> > data.
> >
> > Any help will be greatly appreciated,
> >
> > Best regards,
> >
> > Paul
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained,
reproducible code.

>
>
>
> --
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> Internal Contact Info:
> Phone: 467-7374
> Website:
>
>
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-gr
oups/pdb-biostatistics/pdb-ncb-home.htm
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible
code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Distribution Fitting with R

S Ellison-2
In reply to this post by PaulJr
> I want to actually fit a formal
> statistical distribution to my data using the classical
> methodologies (either Shapiro Wilk, Anderson Darling,
> Chi-Square, etc.).

You probably need to go find out what those things do. Two of them are tests for normality, not fitting methods or distributions, and will not give you distributions to simulate from.

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.