0
$\begingroup$
x= RandomVariate[ExponentialDistribution[2], 10]

y = RandomVariate[ExponentialDistribution[3], 10]

f = EmpiricalDistribution[x]

fy = CDF[f, t] // PiecewiseExpand

g = EmpiricalDistribution[y]

fx = CDF[g, u] // PiecewiseExpand

`Want to find the composition fx of fy `
$\endgroup$
5
  • $\begingroup$ Is this what you are looking for: fz[z_] := CDF[f, CDF[g, z]]? $\endgroup$
    – Domen
    Aug 16, 2021 at 11:08
  • $\begingroup$ Thank you, but not working. $\endgroup$ Aug 18, 2021 at 4:40
  • $\begingroup$ What do you mean by "not working"? I it giving the incorrect results? Does it throw an error? $\endgroup$
    – Domen
    Aug 18, 2021 at 8:11
  • $\begingroup$ Incorrect result, because fx and fy are the cdf of discrete random variable. I want the compostion of those cdf in piecewise expanded form. Your input composite the cdf form of a function $\endgroup$ Aug 19, 2021 at 10:55
  • $\begingroup$ CDF[f, CDF[g, z]] // PiecewiseExpand $\endgroup$
    – Domen
    Aug 19, 2021 at 11:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.