Fitting 4 parameter distributions in S-Plus (or R)

In summary, the speaker is trying to fit sample data to a Johnson SU distribution in S-Plus, but is having trouble using the native S-Plus function fitdistr. They have a function called f.Jsu.fun.takeslist which calculates the PDF for the Johnson SU distribution and have successfully used it for plotting graphs. However, fitdistr does not work with this function. They have previously fitted a Gumbel distribution using a similar approach and it worked well. They are wondering if the issue is due to the Johnson SU distribution having 4 parameters compared to the 2 parameters of the Gumbel distribution. They are also unsure if their data actually follows a Johnson SU distribution and are open to suggestions or advice.
  • #1
mezza8
4
0
Hi, I am trying to fit sample data to a Johnson SU distribution in S-Plus. It seems not many people use S-Plus, so if you are familiar with R then you could help as well.

The code that I have is:


f.Jsu.fun.takeslist(x,g,l,r,e)
which is a function I have made that calculates the PDF of each value of the list x and has parameters g,l,r,e corresponding to the Johnson SU distribution. I know this PDF works because I have used it to plot graphs.

fitdistr(turn$all.turn.y.obs,f.Jsu.fun.takeslist,list(g=0.5,r=3,l=3000,e=-200))
is then what I am trying to use to fit the Johnson SU distribution. fitdistr is a native S-Plus function.


Now, the fitdistr doesn't work on this function.

What I have done previously though is fitted the Gumbel distribution using the same approach by creating my own PDF function, and fitdistr worked and provided a good fit.

The Gumbel distribution is 2 parameter and the Johnson SU is 4 parameter, so I am thinking it is just too many parameters for it to handle, although no limits are specified for fitdistr. I am by no means a master of S-Plus or R so I would appreciate anything you guys have to say on this.

Thanks! :smile:
 
Physics news on Phys.org
  • #2
Can you guarantee that turn$all.turn.y.obs follows a Johnson SU? If you can't then maybe the fit is just not good, anyhow it might also be worth to look for outliers in you data.

The number of parameters should not be the problem, if anything you could also try to increase the number of max iterations for the optimizers used by fitdistr.
 

Related to Fitting 4 parameter distributions in S-Plus (or R)

1. What are parameter distributions?

Parameter distributions are statistical models that describe how a set of data is distributed. They are used to analyze and make predictions about data by fitting the distribution to the data and estimating the values of its parameters.

2. How do you fit 4 parameter distributions in S-Plus or R?

To fit 4 parameter distributions in S-Plus or R, you can use the "fitdistr" function in the "MASS" package. This function allows you to specify the distribution, the data, and the starting values for the parameters. It then uses maximum likelihood estimation to fit the distribution to the data and return the estimated parameter values.

3. What is the purpose of fitting 4 parameter distributions?

Fitting 4 parameter distributions allows you to better understand the underlying distribution of your data and make more accurate predictions. It also allows you to compare different distributions and determine which one best fits your data.

4. What are some common 4 parameter distributions used in S-Plus or R?

Some common 4 parameter distributions used in S-Plus or R include the Weibull distribution, the lognormal distribution, the gamma distribution, and the generalized extreme value distribution. These distributions are often used to model data in fields such as finance, engineering, and environmental sciences.

5. What are some tips for successfully fitting 4 parameter distributions?

Some tips for successfully fitting 4 parameter distributions include starting with good initial parameter values, checking for convergence and model fit, and considering the assumptions and limitations of the chosen distribution. It is also important to carefully interpret the results and consider the implications for your data and research.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
588
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
605
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
668
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
108
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
996
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
2K
Back
Top