Problem with TransformedDistribution The Next CEO of Stack OverflowWhen are `If`, `Piecewise`, `Switch`, and `Which` interchangeable and when are they not?Partial convolution of random variables in random vectorsCalculate PDF and CDF of a product of independent exponentially distributed random variablesConditional probabilityFullSimplify on TransformedDistributionNProbability not reliability analysis?Fitting data to an Normal Inverse Gaussian distributionDependency of parameter to find maximum vanishes after simplificationTransformedDistribution using $k$ iid random variables, but $k$ not fixedDistribution of Function of Random Sum of Random Variables
My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?
Are the names of these months realistic?
"Eavesdropping" vs "Listen in on"
Can I calculate next year's exemptions based on this year's refund/amount owed?
Easy to read palindrome checker
Is French Guiana a (hard) EU border?
Do scriptures give a method to recognize a truly self-realized person/jivanmukta?
(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?
Expressing the idea of having a very busy time
Is it ever safe to open a suspicious HTML file (e.g. email attachment)?
Purpose of level-shifter with same in and out voltages
Prepend last line of stdin to entire stdin
Can this note be analyzed as a non-chord tone?
Spaces in which all closed sets are regular closed
Physiological effects of huge anime eyes
Is there an equivalent of cd - for cp or mv
What is the difference between Statistical Mechanics and Quantum Mechanics
How to use ReplaceAll on an expression that contains a rule
Reference request: Grassmannian and Plucker coordinates in type B, C, D
Can Sneak Attack be used when hitting with an improvised weapon?
What day is it again?
How to find image of a complex function with given constraints?
Inexact numbers as keys in Association?
What CSS properties can the br tag have?
Problem with TransformedDistribution
The Next CEO of Stack OverflowWhen are `If`, `Piecewise`, `Switch`, and `Which` interchangeable and when are they not?Partial convolution of random variables in random vectorsCalculate PDF and CDF of a product of independent exponentially distributed random variablesConditional probabilityFullSimplify on TransformedDistributionNProbability not reliability analysis?Fitting data to an Normal Inverse Gaussian distributionDependency of parameter to find maximum vanishes after simplificationTransformedDistribution using $k$ iid random variables, but $k$ not fixedDistribution of Function of Random Sum of Random Variables
$begingroup$
I am trying to use Mathematica to obtain the probability distribution of $frac12(A + B)$ where $A$ and $B$ are independent random variables each distributed according to the uniform distribution, with lower and upper bounds of $L$ and $H$ respectively.
I suspect the distribution is triangular with lower and upper bounds of $L$ and $H$ respectively and mode equal to $frac12(A + B)$. However, I am having difficulty using TransformedDistribution to show that.
My code is:
[ScriptCapitalD] = TransformedDistribution[1/2 (A + B), B [Distributed] UniformDistribution[L, H], A [Distributed] UniformDistribution[L, H]]
probability-or-statistics distributions
$endgroup$
|
show 4 more comments
$begingroup$
I am trying to use Mathematica to obtain the probability distribution of $frac12(A + B)$ where $A$ and $B$ are independent random variables each distributed according to the uniform distribution, with lower and upper bounds of $L$ and $H$ respectively.
I suspect the distribution is triangular with lower and upper bounds of $L$ and $H$ respectively and mode equal to $frac12(A + B)$. However, I am having difficulty using TransformedDistribution to show that.
My code is:
[ScriptCapitalD] = TransformedDistribution[1/2 (A + B), B [Distributed] UniformDistribution[L, H], A [Distributed] UniformDistribution[L, H]]
probability-or-statistics distributions
$endgroup$
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
Did you tryPDF[[ScriptCapitalD], y]
?
$endgroup$
– JimB
Mar 23 at 19:18
2
$begingroup$
Why not check the PDFs?Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
1
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
andSimplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
1
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35
|
show 4 more comments
$begingroup$
I am trying to use Mathematica to obtain the probability distribution of $frac12(A + B)$ where $A$ and $B$ are independent random variables each distributed according to the uniform distribution, with lower and upper bounds of $L$ and $H$ respectively.
I suspect the distribution is triangular with lower and upper bounds of $L$ and $H$ respectively and mode equal to $frac12(A + B)$. However, I am having difficulty using TransformedDistribution to show that.
My code is:
[ScriptCapitalD] = TransformedDistribution[1/2 (A + B), B [Distributed] UniformDistribution[L, H], A [Distributed] UniformDistribution[L, H]]
probability-or-statistics distributions
$endgroup$
I am trying to use Mathematica to obtain the probability distribution of $frac12(A + B)$ where $A$ and $B$ are independent random variables each distributed according to the uniform distribution, with lower and upper bounds of $L$ and $H$ respectively.
I suspect the distribution is triangular with lower and upper bounds of $L$ and $H$ respectively and mode equal to $frac12(A + B)$. However, I am having difficulty using TransformedDistribution to show that.
My code is:
[ScriptCapitalD] = TransformedDistribution[1/2 (A + B), B [Distributed] UniformDistribution[L, H], A [Distributed] UniformDistribution[L, H]]
probability-or-statistics distributions
probability-or-statistics distributions
edited Mar 24 at 12:59
J. M. is slightly pensive♦
98.8k10311467
98.8k10311467
asked Mar 23 at 19:06
user120911user120911
75128
75128
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
Did you tryPDF[[ScriptCapitalD], y]
?
$endgroup$
– JimB
Mar 23 at 19:18
2
$begingroup$
Why not check the PDFs?Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
1
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
andSimplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
1
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35
|
show 4 more comments
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
Did you tryPDF[[ScriptCapitalD], y]
?
$endgroup$
– JimB
Mar 23 at 19:18
2
$begingroup$
Why not check the PDFs?Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
1
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
andSimplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
1
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
Did you try
PDF[[ScriptCapitalD], y]
?$endgroup$
– JimB
Mar 23 at 19:18
$begingroup$
Did you try
PDF[[ScriptCapitalD], y]
?$endgroup$
– JimB
Mar 23 at 19:18
2
2
$begingroup$
Why not check the PDFs?
Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
$begingroup$
Why not check the PDFs?
Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
1
1
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.
Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
and Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.
Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
and Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
1
1
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35
|
show 4 more comments
2 Answers
2
active
oldest
votes
$begingroup$
You get what you expect if you do it it in two steps
[ScriptCapitalD] =
TransformedDistribution[x/2,
x [Distributed] TransformedDistribution[(A + B),
B [Distributed] UniformDistribution[L, H],
A [Distributed] UniformDistribution[L, H]]]
(* TriangularDistribution[L, H] *)
$endgroup$
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
add a comment |
$begingroup$
PDF[[ScriptCapitalD]][z]
(((-30 + z)Sign[-30 + z])/2 - (-20 + z)
Sign[-20 + z] + ((-10 + z)*Sign[-10 + z])/2)/100
For plotting, assign values to L
and H
:
L = 10; H = 30;
Plot[Evaluate@PDF[[ScriptCapitalD]][x], x, 10, 30]
pdF[l_, h_] := Module[L = l, H = h, Evaluate[PDF[[ScriptCapitalD]]]]
Plot[Evaluate @ Flatten@Table[pdF[l, h][x], l, 0, 5, h, 10, 15], x, 0, 15,
PlotRange -> All,
PlotLegends -> (Flatten @ Table[ToString@l, h, l, 0, 5, h, 10, 15])]
$endgroup$
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
add a comment |
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193838%2fproblem-with-transformeddistribution%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You get what you expect if you do it it in two steps
[ScriptCapitalD] =
TransformedDistribution[x/2,
x [Distributed] TransformedDistribution[(A + B),
B [Distributed] UniformDistribution[L, H],
A [Distributed] UniformDistribution[L, H]]]
(* TriangularDistribution[L, H] *)
$endgroup$
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
add a comment |
$begingroup$
You get what you expect if you do it it in two steps
[ScriptCapitalD] =
TransformedDistribution[x/2,
x [Distributed] TransformedDistribution[(A + B),
B [Distributed] UniformDistribution[L, H],
A [Distributed] UniformDistribution[L, H]]]
(* TriangularDistribution[L, H] *)
$endgroup$
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
add a comment |
$begingroup$
You get what you expect if you do it it in two steps
[ScriptCapitalD] =
TransformedDistribution[x/2,
x [Distributed] TransformedDistribution[(A + B),
B [Distributed] UniformDistribution[L, H],
A [Distributed] UniformDistribution[L, H]]]
(* TriangularDistribution[L, H] *)
$endgroup$
You get what you expect if you do it it in two steps
[ScriptCapitalD] =
TransformedDistribution[x/2,
x [Distributed] TransformedDistribution[(A + B),
B [Distributed] UniformDistribution[L, H],
A [Distributed] UniformDistribution[L, H]]]
(* TriangularDistribution[L, H] *)
answered Mar 23 at 20:12
Bob HanlonBob Hanlon
61.1k33598
61.1k33598
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
add a comment |
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
$begingroup$
That is very nice!
$endgroup$
– user120911
Mar 23 at 20:24
add a comment |
$begingroup$
PDF[[ScriptCapitalD]][z]
(((-30 + z)Sign[-30 + z])/2 - (-20 + z)
Sign[-20 + z] + ((-10 + z)*Sign[-10 + z])/2)/100
For plotting, assign values to L
and H
:
L = 10; H = 30;
Plot[Evaluate@PDF[[ScriptCapitalD]][x], x, 10, 30]
pdF[l_, h_] := Module[L = l, H = h, Evaluate[PDF[[ScriptCapitalD]]]]
Plot[Evaluate @ Flatten@Table[pdF[l, h][x], l, 0, 5, h, 10, 15], x, 0, 15,
PlotRange -> All,
PlotLegends -> (Flatten @ Table[ToString@l, h, l, 0, 5, h, 10, 15])]
$endgroup$
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
add a comment |
$begingroup$
PDF[[ScriptCapitalD]][z]
(((-30 + z)Sign[-30 + z])/2 - (-20 + z)
Sign[-20 + z] + ((-10 + z)*Sign[-10 + z])/2)/100
For plotting, assign values to L
and H
:
L = 10; H = 30;
Plot[Evaluate@PDF[[ScriptCapitalD]][x], x, 10, 30]
pdF[l_, h_] := Module[L = l, H = h, Evaluate[PDF[[ScriptCapitalD]]]]
Plot[Evaluate @ Flatten@Table[pdF[l, h][x], l, 0, 5, h, 10, 15], x, 0, 15,
PlotRange -> All,
PlotLegends -> (Flatten @ Table[ToString@l, h, l, 0, 5, h, 10, 15])]
$endgroup$
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
add a comment |
$begingroup$
PDF[[ScriptCapitalD]][z]
(((-30 + z)Sign[-30 + z])/2 - (-20 + z)
Sign[-20 + z] + ((-10 + z)*Sign[-10 + z])/2)/100
For plotting, assign values to L
and H
:
L = 10; H = 30;
Plot[Evaluate@PDF[[ScriptCapitalD]][x], x, 10, 30]
pdF[l_, h_] := Module[L = l, H = h, Evaluate[PDF[[ScriptCapitalD]]]]
Plot[Evaluate @ Flatten@Table[pdF[l, h][x], l, 0, 5, h, 10, 15], x, 0, 15,
PlotRange -> All,
PlotLegends -> (Flatten @ Table[ToString@l, h, l, 0, 5, h, 10, 15])]
$endgroup$
PDF[[ScriptCapitalD]][z]
(((-30 + z)Sign[-30 + z])/2 - (-20 + z)
Sign[-20 + z] + ((-10 + z)*Sign[-10 + z])/2)/100
For plotting, assign values to L
and H
:
L = 10; H = 30;
Plot[Evaluate@PDF[[ScriptCapitalD]][x], x, 10, 30]
pdF[l_, h_] := Module[L = l, H = h, Evaluate[PDF[[ScriptCapitalD]]]]
Plot[Evaluate @ Flatten@Table[pdF[l, h][x], l, 0, 5, h, 10, 15], x, 0, 15,
PlotRange -> All,
PlotLegends -> (Flatten @ Table[ToString@l, h, l, 0, 5, h, 10, 15])]
answered Mar 23 at 19:25
kglrkglr
190k10206424
190k10206424
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
add a comment |
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
$begingroup$
That confirms my intution, but can you get Mathematica to output the PDF for the triangular distribution? That is what I am having trouble doing.
$endgroup$
– user120911
Mar 23 at 19:30
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193838%2fproblem-with-transformeddistribution%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
That was a typo. But I am still not getting what I expect.
$endgroup$
– user120911
Mar 23 at 19:16
$begingroup$
Did you try
PDF[[ScriptCapitalD], y]
?$endgroup$
– JimB
Mar 23 at 19:18
2
$begingroup$
Why not check the PDFs?
Simplify[PDF[TransformedDistribution[(a + b)/2, a, b [Distributed] UniformDistribution[l, h, l, h]], t] == PDF[TriangularDistribution[l, h], t], l < t < h]
$endgroup$
– J. M. is slightly pensive♦
Mar 23 at 20:04
1
$begingroup$
I think I have found a bug! Try the following two expressions. The only difference is that I use U in one and H in the other for the upper limit.
Simplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, U, L, U]], t] == PDF[TriangularDistribution[L, U], t], L < t < U]
andSimplify[PDF[TransformedDistribution[(A + B)/2, A, B [Distributed] UniformDistribution[L, H, L, H]], t] == PDF[TriangularDistribution[L, H], t], L < t < H]
$endgroup$
– user120911
Mar 23 at 20:35
1
$begingroup$
@user120911 It does look like a bug to me. I think you should report it to WRI.
$endgroup$
– Silvia
Mar 24 at 19:35