I don't believe the term "fairly sampled data set" is well defined.
Given the two types of constraints (an inequality and an equality), you'll likely need to solve explicitly for the equality (p2
), generate samples from a known multivariate distribution, and then Select
the subset that satisfies the inequality (p1
).
Suppose p2 = t1^2 + t2^2 - t3^2
is the equality. Then we can solve for t3
as follows:
p2 = t1^2 + t2^2 - t3^2;
Solve[p2 == 0, t3]
(* {{t3 -> -Sqrt[t1^2 + t2^2]}, {t3 -> Sqrt[t1^2 + t2^2]}} *)
We'll assume that t3
could take either value equally likely. Also let
p1 = Total[{t1, t2, t3}]
Now generate the restricted samples:
n = 10000; (* Maximum sample size *)
(* Generate random sample of (t1, t2) from a bivariate normal \
distribution *)
ρ = 0;
t12 = RandomVariate[BinormalDistribution[{0, 0}, {1, 1}, ρ], n];
(* Add in the value of t3 determined by the equality *)
t3 = (Sqrt[#[[1]]^2 + #[[2]]^2] & /@
t12)*(2*RandomVariate[BernoulliDistribution[1/2], n] - 1);
t123 = Join[t12, Transpose[{t3}], 2];
(* Select the samples that satisfy p1 (the inequality constraint) *)
sample = Select[t123, Total[#] > 0 &];
(* Show the results *)
GraphicsGrid[{{Graphics[Text[Style["ρ = 0", Bold, Italic, 36]]],
ListPlot[sample[[All, {1, 2}]], AxesLabel -> {"t1", "t2"},
PlotRange -> {{-4, 4}, {-4, 4}}, AspectRatio -> 1]},
{ListPlot[sample[[All, {1, 3}]], AxesLabel -> {"t1", "t3"},
PlotRange -> {{-4, 4}, {-4, 4}}, AspectRatio -> 1],
ListPlot[sample[[All, {2, 3}]], AxesLabel -> {"t2", "t3"},
PlotRange -> {{-4, 4}, {-4, 4}}, AspectRatio -> 1]}}]
But now use $\rho=0.9$:
Different values of ρ result in wildly different samples as does the choice of the joint distribution.
So setting the restrictions is just part of what needs to be specified. You also need to specify the joint distribution of t1
, t2
, and t3
. (With the example I used you just need to specify the joint distribution of t1
and t2
because one can solve for t3
in terms of t1
and t2
.)
RandomPoint @ ImplicitRegion[conditions, parameters]
. $\endgroup$p1
andp2
, I don't think there's much specific advice one can give. The general advice should help but might not capitalize on efficiencies knowing more information. $\endgroup$