Message Boards Message Boards

"FindCopula" or "FindCopulaParameters" functionality?

Posted 1 year ago

Might be a trivial question, but while FindDistribution, CopulaDistribution, and FindDistrbiutionParameters are built-in function, I couldn't find built-in "FindCopula" or "FindCopulaParameters" in the function library. Is Mathematica working on it? Is there a way to suggest to the development team? Meanwhile, could anybody help pls? So far my team has been using 'R' for this. Kind thanks!

pls note: this question is similar, but not identical, to https://mathematica.stackexchange.com/questions/261320/can-the-copuladistributions-be-fitted.

POSTED BY: Poomjai Nacaskul
Posted 1 year ago

While I don't think that I would trust a FindCopula function, there's no need for a FindCopulaParameters because FindDistributionParameters already provides that functionality. Here's an example:

d = CopulaDistribution["Product", {GeometricDistribution[\[Lambda]1], PoissonDistribution[\[Lambda]2]}];
n = 1000;
SeedRandom[12345];
x = RandomVariate[d /. {\[Lambda]1 -> 0.3, \[Lambda]2 -> 4}, n];
mle = FindDistributionParameters[x, d]
(* {\[Lambda]1 -> 0.304507, \[Lambda]2 -> 4.057} *)

And another:

d = CopulaDistribution[{"FGM", \[Alpha]}, {NormalDistribution[\[Mu]1, \[Sigma]1],
  NormalDistribution[\[Mu]2, \[Sigma]2]}];
n = 1000;
SeedRandom[12345];
x = RandomVariate[d /. {\[Mu]1 -> -1, \[Sigma]1 -> 2, \[Mu]2 -> 1, \[Sigma]2 -> 1/2, \[Alpha] -> 0.2}, n];
mle = FindDistributionParameters[x, d]
(* {\[Alpha] -> 0.221636, \[Mu]1 -> -1.04899, \[Sigma]1 -> 1.99398, \[Mu]2 -> 0.996975, \[Sigma]2 -> 0.481067} *)

But FindDistributionParameters for all distributions suffers from not giving an estimated covariance matrix for the parameters estimates. For that you'll need to write your own using LogLikelihood and something like FindMaximum.

POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract