# How to write a Bivariate custom distribution, calculate p value and other properties?

This distribution is univariate

EE = ProbabilityDistribution[
{
"CDF",
(1 - E^-(λ*x))^α
}
, {x, 0, ∞}
, Assumptions -> {λ > 0, α > 0}
];


I want to write it as bivariate to calculate p-value of this data X represents body weight in kilograms and Y represents brain weight in grams of male cats.

The bivariate data set is given below:

(2, 6.5), (2, 6.5), (2.1, 10.1), (2.2, 7.2), (2.2, 7.6), (2.2, 7.9), (2.2, 8.5), (2.2, 9.1), (2.2,9.6), (2.2, 9.6), (2.2, 10.7), (2.3, 9.6), (2.4, 7.3), (2.4, 7.9), (2.4, 7.9), (2.4, 9.1), (2.4,9.3), (2.5, 7.9), (2.5, 8.6), (2.5, 8.8), (2.5, 8.8), (2.5, 9.3), (2.5, 11), (2.5, 12.7), (2.5,12.7), (2.6, 7.7), (2.6, 8.3), (2.6, 9.4), (2.6, 9.4), (2.6, 10.5), (2.6, 11.5), (2.7, 8), (2.7, 9),(2.7, 9.6), (2.7, 9.6), (2.7, 9.8), (2.7, 10.4), (2.7, 11.1), (2.7, 12), (2.7, 12.5), (2.8, 9.1),(2.8, 10), (2.8, 10.2), (2.8, 11.4), (2.8, 12), (2.8, 13.3), (2.8, 13.5), (2.9, 9.4), (2.9, 10.1),(2.9, 10.6), (2.9, 11.3), (2.9, 11.8), (3, 10), (3, 10.4), (3, 10.6), (3, 11.6), (3, 12.2), (3,12.4), (3, 12.7), (3, 13.3), (3, 13.8), (3.1, 9.9), (3.1, 11.5), (3.1, 12.1), (3.1, 12.5), (3.1,13), (3.1, 14.3), (3.2, 11.6), (3.2, 11.9), (3.2, 12.3), (3.2, 13), (3.2, 13.5), (3.2, 13.6),(3.3, 11.5), (3.3, 12), (3.3, 14.1), (3.3, 14.9), (3.3, 15.4), (3.4, 11.2), (3.4, 12.2), (3.4,12.4), (3.4, 12.8), (3.4, 14.4), (3.5, 11.7), (3.5, 12.9), (3.5, 15.6), (3.5, 15.7), (3.5, 17.2),(3.6, 11.8), (3.6, 13.3), (3.6, 14.8), (3.6, 15), (3.7, 11), (3.8, 14.8), (3.8, 16.8), (3.9,14.4), (3.9, 20.5)


or using quantile to generate data because I want to use it in a simulation

• Could you please make further efforts to explain what you want? Also, your data is not in a format that is easy for us to copy into our computers. I don't think this question can be answered in its current form. Please edit it promptly to avoid being closed. Commented Aug 7, 2022 at 13:55
• y doesn't appear in your model for the distribution. Based on your understanding of the processes involved, you need to define a model that includes both x and y. We have zero knowledge of your problem. Commented Aug 7, 2022 at 15:10
• Calculating a $P$-value requires a specified hypothesis and a test statistic. Please include that information. Are you wanting to make inferences about a bivariate probability distribution (which you should specify how the data was collected) or is this a regression problem? (i.e., predicting brain weight given body weight)
– JimB
Commented Aug 7, 2022 at 22:05

\$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global*"]


When posting data, use the proper list structure.

data = {{2, 6.5}, {2, 6.5}, {2.1, 10.1}, {2.2, 7.2}, {2.2, 7.6}, {2.2,
7.9}, {2.2, 8.5}, {2.2, 9.1}, {2.2, 9.6}, {2.2, 9.6}, {2.2, 10.7}, {2.3,
9.6}, {2.4, 7.3}, {2.4, 7.9}, {2.4, 7.9}, {2.4, 9.1}, {2.4, 9.3}, {2.5,
7.9}, {2.5, 8.6}, {2.5, 8.8}, {2.5, 8.8}, {2.5, 9.3}, {2.5, 11}, {2.5,
12.7}, {2.5, 12.7}, {2.6, 7.7}, {2.6, 8.3}, {2.6, 9.4}, {2.6, 9.4}, {2.6,
10.5}, {2.6, 11.5}, {2.7, 8}, {2.7, 9}, {2.7, 9.6}, {2.7, 9.6}, {2.7,
9.8}, {2.7, 10.4}, {2.7, 11.1}, {2.7, 12}, {2.7, 12.5}, {2.8, 9.1}, {2.8,
10}, {2.8, 10.2}, {2.8, 11.4}, {2.8, 12}, {2.8, 13.3}, {2.8, 13.5}, {2.9,
9.4}, {2.9, 10.1}, {2.9, 10.6}, {2.9, 11.3}, {2.9, 11.8}, {3, 10}, {3,
10.4}, {3, 10.6}, {3, 11.6}, {3, 12.2}, {3, 12.4}, {3, 12.7}, {3,
13.3}, {3, 13.8}, {3.1, 9.9}, {3.1, 11.5}, {3.1, 12.1}, {3.1, 12.5}, {3.1,
13}, {3.1, 14.3}, {3.2, 11.6}, {3.2, 11.9}, {3.2, 12.3}, {3.2, 13}, {3.2,
13.5}, {3.2, 13.6}, {3.3, 11.5}, {3.3, 12}, {3.3, 14.1}, {3.3,
14.9}, {3.3, 15.4}, {3.4, 11.2}, {3.4, 12.2}, {3.4, 12.4}, {3.4,
12.8}, {3.4, 14.4}, {3.5, 11.7}, {3.5, 12.9}, {3.5, 15.6}, {3.5,
15.7}, {3.5, 17.2}, {3.6, 11.8}, {3.6, 13.3}, {3.6, 14.8}, {3.6,
15}, {3.7, 11}, {3.8, 14.8}, {3.8, 16.8}, {3.9, 14.4}, {3.9, 20.5}};

{{xmin, xmax}, {ymin, ymax}} = MinMax /@ Transpose[data];


Without any knowledge of your problem, use SmoothKernelDistribution

distSK = SmoothKernelDistribution[data];

Plot3D[PDF[distSK, {x, y}],
{x, xmin, xmax}, {y, ymin, ymax},
PlotPoints -> 50,
AxesLabel -> (Style[#, 14] & /@
{Rotate["Body Weight (kg)", -22 Degree],
Rotate["Brain Weight (g)", 61 Degree]}),
ImageSize -> 432]


Plot3D[CDF[distSK, {x, y}],
{x, xmin, xmax}, {y, ymin, ymax},
PlotPoints -> 50,
AxesLabel -> (Style[#, 14] & /@
{Rotate["Body Weight (kg)", -22 Degree],
Rotate["Brain Weight (g)", 61 Degree]}),
ImageSize -> 432]


(covSK = Covariance[distSK]) // MatrixForm
`