How do I create a TransformedDistribution
that uses $k$ independent identically distributed (i.i.d.) random variables?
For example, I can derive a chi-squared distribution with 2 degrees of freedom like so:
In[1]:= TransformedDistribution[x^2 + y^2,
{x \[Distributed] NormalDistribution[], y \[Distributed] NormalDistribution[]}]
Out[1]:= ChiSquareDistribution[2]
Given an arbitrary integer $k$, how do I similarly derive a chi-squared distribution with $k$ degrees of freedom using TransformedDistribution
?
Answer
In this case, you can simply use ChiSquareDistribution[k]
, but in the general case, of the sum of k
variables distributed as dist
:
iid[k_, dist_] := TransformedDistribution[
Sum[a[i], {i, k}],
Table[Distributed[a[i], dist], {i, k}]
]
Comments
Post a Comment