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]];
sorry, just realised my flipancy lead to a lazy answer - had to fix the "prob=" eqn
doug fromoz
- 141
- 1
- 6