3

There is a function FindDistribution that finds a distribution from the given data.

But what if I'm given moments and what to find a distribution.

Is there any function for this?

Thank you.

    j[x_] := Moment[JohnsonDistribution["SL", gamma, delta, 0, lambda],x];
FindRoot[{j[1] == 1.2974425414, j[2] == 5.252267250245984, 
j[3] == 112.50634898225843576187}, {{delta, 
1.5}, {gamma, -1.2}, {lambda, 0.4}}, WorkingPrecision -> 250, 
MaxIterations -> 10000]

It gives Encountered a singular Jacobian at the point {delta,gamma,lambda} = \ {1.5,-1.2,0.4}. Try perturbing the initial point(s)`.

The histograms of the distribution are shown below:enter image description here enter image description here

Paul R
  • 143
  • 5
  • 1
    "if I'm given moments" All moments or just some moments? With all moments, build the characteristic function, take its inverse Fourier transform to get the PDF. Then use ProbabilityDistribution to define the distribution from the PDF. – Bob Hanlon Jan 23 '24 at 18:27
  • 1
    If you only know a few sample moments AND you have a distribution in mind, then you can equate the sample moments to the theoretical moments and solve for the distribution parameters. This is known as the "Method of Moments". There are several examples on this site. Here's one: https://mathematica.stackexchange.com/questions/108052/estimate-parameters-of-a-derived-distribution/108075#108075. – JimB Jan 23 '24 at 18:31
  • Is this any different from your question at https://stats.stackexchange.com/questions/635999/find-pdf-from-approximated-mgf ? – JimB Jan 23 '24 at 18:37
  • No. I don't have MGF, just a finite number of moments. I tried to use the method of moments, but Mathematica doesn't give a solution. – Paul R Jan 23 '24 at 18:41
  • What Mathematica code and distribution did you use? – JimB Jan 23 '24 at 19:02
  • Mathematica 14. And to use the method of moments, I need to know the distribution. But I don't know it. – Paul R Jan 23 '24 at 19:09
  • I mean specifically what was the code you used. Please add that code to your question. – JimB Jan 23 '24 at 19:12
  • @JimB , I've added the code. – Paul R Jan 23 '24 at 19:18
  • 2
    I've deleted my answer because I now see that for this particular Johnson distribution, 3 moments are not sufficient to obtain unique estimates of the parameters. (This is typically not the case in that in practice 3 parameters requires just 3 moments.) But for this Johnson distribution the 3rd moment is the cube of the ratio of the second to the first moment. This relationship is probably the reason for the error you're seeing. So very loosely, the first 3 moments only provide 2 of the necessary pieces of information to estimate the 3 parameters. – JimB Jan 25 '24 at 05:26
  • I can add more moments. – Paul R Jan 25 '24 at 06:39
  • Also, you said that the 3rd moment is the cube of the ratio of the second to the first moment, but $\left(\frac{5.252267250245984}{1.2974425414}\right)^3$ is not equal to $112.50634898225843576187$. – Paul R Jan 25 '24 at 06:52
  • I agree. That means your moments and not from a Johnson distribution. Here's the proof: {M1, M2, M3} = Moment[JohnsonDistribution["SL", \[Gamma], \[Delta], 0, \[Lambda]], #] & /@ {1, 2, 3}; (M2/M1)^3 - M3 // Simplify results in 0. The moments you provide don't result in anything close what is required for that Johnson distribution. – JimB Jan 25 '24 at 15:03
  • Ahh, I see. Thank you for your help. – Paul R Jan 25 '24 at 17:25
  • For whatever it's worth, I think you have a good question but there just aren't enough details for anyone to provide an answer. If you can generate a large number of samples, nonparametric density estimation (using SmoothKernelDistribution or SmoothHistogram) can provide a close approximation of the density. If you need to estimate parameters, then you need to specify a plausible distribution. – JimB Jan 25 '24 at 17:28
  • But I think that the above distribution is close to Johnson and LogNormal. Thank you for telling about SmoothKernelDistribution, – Paul R Jan 25 '24 at 17:42
  • If one fits a log normal with the first two moments (sol = Solve[{j[1] == 1.2974425414, j[2] == 5.252267250245984, \[Sigma] > 0}, {\[Mu], \[Sigma]}, Reals][[1]]; j[3] /. sol) results in a 3rd moment of 66.3401 which is half of your 112.50634898225843576187. So a log normal does not seem likely. – JimB Jan 26 '24 at 02:49
  • You are correct. – Paul R Jan 26 '24 at 09:58

0 Answers0