Skip to main content
fixed typo
Source Link
GandHDistribution/: DistributionParameterQ[GandHDistribution[A_, B_, g_, h_]] := And[
    If[FreeQ[N[A], Complex], True,
       Message[GandHDistribution::realparm, A]; False],
    If[FreeQ[N[B], Complex], True,
       Message[GandHDistribution::realparm, B]; False],
    If[FreeQ[N[g], Complex], True,
       Message[GandHDistribution::realparm, g]; False],
    If[FreeQ[N[h], Complex], True,
       Message[GandHDistribution::realparm, h]; False]
];

GandHDistribution::posparm =
  "Parameter `1` is expected to be positive."

GandHDistribution::realparm = "Parameter `1` is expected to be real."

GandHDistribution/: 
  DistributionParameterAssumptions[GandHDistribution[A_, B_, g_, h_]]:=
Element[{A,B,g,h},Reals]   

GandHDistribution/: 
  RandomVariate[GandHDistribution[A_, B_, g_, h_], dim_] :=
    Module[
      {dimv=Flatten[{dim}] (*if dim is single int, convert to single element list*)},
      Map[Xgh[A, B, g, h, #]&, RandomReal[{0RandomVariate[NormalDistribution[0,1}1],dimv], {Length@dimv}]
    ] /; (IntegerQ[dim] && dim > 0) || VectorQ[dim, (IntegerQ[#] && # > 0)&];

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
GandHDistribution/: DistributionParameterQ[GandHDistribution[A_, B_, g_, h_]] := And[
    If[FreeQ[N[A], Complex], True,
       Message[GandHDistribution::realparm, A]; False],
    If[FreeQ[N[B], Complex], True,
       Message[GandHDistribution::realparm, B]; False],
    If[FreeQ[N[g], Complex], True,
       Message[GandHDistribution::realparm, g]; False],
    If[FreeQ[N[h], Complex], True,
       Message[GandHDistribution::realparm, h]; False]
];

GandHDistribution::posparm =
  "Parameter `1` is expected to be positive."

GandHDistribution::realparm = "Parameter `1` is expected to be real."

GandHDistribution/: 
  DistributionParameterAssumptions[GandHDistribution[A_, B_, g_, h_]]:=
Element[{A,B,g,h},Reals]   

GandHDistribution/: 
  RandomVariate[GandHDistribution[A_, B_, g_, h_], dim_] :=
    Module[
      {dimv=Flatten[{dim}] (*if dim is single int, convert to single element list*)},
      Map[Xgh[A, B, g, h, #]&, RandomReal[{0,1},dimv], {Length@dimv}]
    ] /; (IntegerQ[dim] && dim > 0) || VectorQ[dim, (IntegerQ[#] && # > 0)&];

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
GandHDistribution/: DistributionParameterQ[GandHDistribution[A_, B_, g_, h_]] := And[
    If[FreeQ[N[A], Complex], True,
       Message[GandHDistribution::realparm, A]; False],
    If[FreeQ[N[B], Complex], True,
       Message[GandHDistribution::realparm, B]; False],
    If[FreeQ[N[g], Complex], True,
       Message[GandHDistribution::realparm, g]; False],
    If[FreeQ[N[h], Complex], True,
       Message[GandHDistribution::realparm, h]; False]
];

GandHDistribution::posparm =
  "Parameter `1` is expected to be positive."

GandHDistribution::realparm = "Parameter `1` is expected to be real."

GandHDistribution/: 
  DistributionParameterAssumptions[GandHDistribution[A_, B_, g_, h_]]:=
Element[{A,B,g,h},Reals]   

GandHDistribution/: 
  RandomVariate[GandHDistribution[A_, B_, g_, h_], dim_] :=
    Module[
      {dimv=Flatten[{dim}] (*if dim is single int, convert to single element list*)},
      Map[Xgh[A, B, g, h, #]&, RandomVariate[NormalDistribution[0,1],dimv], {Length@dimv}]
    ] /; (IntegerQ[dim] && dim > 0) || VectorQ[dim, (IntegerQ[#] && # > 0)&];

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
added RandomVariate
Source Link
DistributionDomainGandHDistribution/: DistributionParameterQ[GandHDistribution[A_, B_, g_, h_]] := And[
    If[FreeQ[N[A], Complex], True,
DistributionParameterAssumptions       Message[GandHDistribution::realparm, A]; False],
    If[FreeQ[N[B], Complex], True,
       Message[GandHDistribution::realparm, B]; False],
    If[FreeQ[N[g], Complex], True,
       Message[GandHDistribution::realparm, g]; False],
    If[FreeQ[N[h], Complex], True,
       Message[GandHDistribution::realparm, h]; False]
];

GandHDistribution::posparm =
  "Parameter `1` is expected to be positive."

GandHDistribution::realparm = "Parameter `1` is expected to be real."

GandHDistribution/: 
  DistributionParameterAssumptions[GandHDistribution[A_, B_, g_, h_]]:=
Element[{A,B,g,h},Reals]   

GandHDistribution/: 
  RandomVariate[GandHDistribution[A_, B_, g_, h_], dim_] :=
    Module[
      {dimv=Flatten[{dim}] (*if dim is single int, convert to single element list*)},
      Map[Xgh[A, B, g, h, #]&, RandomReal[{0,1},dimv], {Length@dimv}]
    ] /; (IntegerQ[dim] && dim > 0) || VectorQ[dim, (IntegerQ[#] && # > 0)&];

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
DistributionDomain

DistributionParameterAssumptions

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
GandHDistribution/: DistributionParameterQ[GandHDistribution[A_, B_, g_, h_]] := And[
    If[FreeQ[N[A], Complex], True,
       Message[GandHDistribution::realparm, A]; False],
    If[FreeQ[N[B], Complex], True,
       Message[GandHDistribution::realparm, B]; False],
    If[FreeQ[N[g], Complex], True,
       Message[GandHDistribution::realparm, g]; False],
    If[FreeQ[N[h], Complex], True,
       Message[GandHDistribution::realparm, h]; False]
];

GandHDistribution::posparm =
  "Parameter `1` is expected to be positive."

GandHDistribution::realparm = "Parameter `1` is expected to be real."

GandHDistribution/: 
  DistributionParameterAssumptions[GandHDistribution[A_, B_, g_, h_]]:=
Element[{A,B,g,h},Reals]   

GandHDistribution/: 
  RandomVariate[GandHDistribution[A_, B_, g_, h_], dim_] :=
    Module[
      {dimv=Flatten[{dim}] (*if dim is single int, convert to single element list*)},
      Map[Xgh[A, B, g, h, #]&, RandomReal[{0,1},dimv], {Length@dimv}]
    ] /; (IntegerQ[dim] && dim > 0) || VectorQ[dim, (IntegerQ[#] && # > 0)&];

GandHDistribution/: 
  Random`Private`
    DistributionVector[GandHDistribution[A_, B_, g_, h_],
                       n_Integer, prec_?Positive] :=
      Xgh[A, B, g, h, RandomVariate[NormalDistribution[0, 1], n, 
        WorkingPrecision -> prec]];

GandHDistribution/: 
 Statistics`CopulaDistributionDump` 
   UnivariateDistributionListQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    ContinuousUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := True;

GandHDistribution/: 
  Statistics`Library`
    DiscreteUnivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    ContinuousMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DiscreteMultivariateDistributionQ[GandHDistribution[A_, B_, g_, h_]] := False;

GandHDistribution/: 
  Statistics`Library`
    DistributionNParameterQ[GandHDistribution[A_, B_, g_, h_]]:=
     DistributionParameterQ[GandHDistribution[A, B, g, h]];
sorry, just realised my flipancy lead to a lazy answer - had to fix the "prob=" eqn
Source Link
prob = CDF[NormalDistribution[0, 1], (Z /. FindRoot[Xgh == x, {Z,0}])] 
prob = Z /. FindRoot[Xgh == x, {Z,0}] 
prob = CDF[NormalDistribution[0, 1], (Z /. FindRoot[Xgh == x, {Z,0}])] 
re-tidied closer to my original post
Source Link
Loading
Improved formatting
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading
added 253 characters in body
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading
added 3 characters in body
Source Link
Loading
added 9 characters in body
Source Link
Loading
edited body
Source Link
Loading
Source Link
Loading