Weighted smooth histogramSmooth/histogram a 2D setIs there a way to output histogram x and y data without using the Histogram chart function?Creating histogram?Log-log scale smooth histogramHistogram distributionHistogram: Format issueHow to plot paired smooth histogram/distribution plots?Smooth Density Histogram bounded on non-rectangular domain
Can MuseScore be used programmatically?
How to check whether a sublist exist in a huge database lists in a fast way?
What is Soda Fountain Etiquette?
Is it unusual for a math department not to have a mail/web server?
Contours of a national emergency in the United States
What's the point of fighting monsters in Zelda BoTW?
Which old Technic set included large yellow motor?
Who was the most successful German spy against Great Britain in WWII, from the contemporary German perspective?
Papers on arXiv solving the same problem at the same time
What is this fighter jet at Weymouth NAS?
Dealing with stress in coding interviews
Is this password scheme legit?
Why does matter stays collapsed following the supernova explosion?
How can I download a file from a host I can only SSH to through another host?
How is linear momentum conserved in case of a freely falling body?
1mth baby boy keeps peeing through diapers, sometimes diper seems practically unused
To what extent should we fear giving offense?
Expanding powers of expressions of the form ax+b
Unlock your Lock
Billiard balls collision
How many petaflops does it take to land on the moon? What does Artemis need with an Aitken?
Does a Mace of Disruption's Frightened effect override undead immunity to the Frightened condition?
Router on a stick not connecting 2 different VLANs
Can I get a PhD for developing an educational software?
Weighted smooth histogram
Smooth/histogram a 2D setIs there a way to output histogram x and y data without using the Histogram chart function?Creating histogram?Log-log scale smooth histogramHistogram distributionHistogram: Format issueHow to plot paired smooth histogram/distribution plots?Smooth Density Histogram bounded on non-rectangular domain
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I have a large list $L$ ($|L| sim 100000$) of pairs $x_i,w_i in mathbfR times [0,1]$ subject to the constraint that
$qquad sum w_i = 1.$
I would like to use $L$ to graph a smooth function which "approximates" the PDF
$qquad sum w_i cdot delta(x - x_i)$
If all the $w_i$ were equal to $1/|L|$, then I could simply take the list of the numbers $x_i$ and apply SmoothHistogram. Is there any way to do a "weighted" smooth histogram? If not, some other way?
In practice, the numbers $w_i$ satisfy $5/|L| ge w_i ge 1/(5 |L|)$.
histograms
New contributor
$endgroup$
add a comment |
$begingroup$
I have a large list $L$ ($|L| sim 100000$) of pairs $x_i,w_i in mathbfR times [0,1]$ subject to the constraint that
$qquad sum w_i = 1.$
I would like to use $L$ to graph a smooth function which "approximates" the PDF
$qquad sum w_i cdot delta(x - x_i)$
If all the $w_i$ were equal to $1/|L|$, then I could simply take the list of the numbers $x_i$ and apply SmoothHistogram. Is there any way to do a "weighted" smooth histogram? If not, some other way?
In practice, the numbers $w_i$ satisfy $5/|L| ge w_i ge 1/(5 |L|)$.
histograms
New contributor
$endgroup$
add a comment |
$begingroup$
I have a large list $L$ ($|L| sim 100000$) of pairs $x_i,w_i in mathbfR times [0,1]$ subject to the constraint that
$qquad sum w_i = 1.$
I would like to use $L$ to graph a smooth function which "approximates" the PDF
$qquad sum w_i cdot delta(x - x_i)$
If all the $w_i$ were equal to $1/|L|$, then I could simply take the list of the numbers $x_i$ and apply SmoothHistogram. Is there any way to do a "weighted" smooth histogram? If not, some other way?
In practice, the numbers $w_i$ satisfy $5/|L| ge w_i ge 1/(5 |L|)$.
histograms
New contributor
$endgroup$
I have a large list $L$ ($|L| sim 100000$) of pairs $x_i,w_i in mathbfR times [0,1]$ subject to the constraint that
$qquad sum w_i = 1.$
I would like to use $L$ to graph a smooth function which "approximates" the PDF
$qquad sum w_i cdot delta(x - x_i)$
If all the $w_i$ were equal to $1/|L|$, then I could simply take the list of the numbers $x_i$ and apply SmoothHistogram. Is there any way to do a "weighted" smooth histogram? If not, some other way?
In practice, the numbers $w_i$ satisfy $5/|L| ge w_i ge 1/(5 |L|)$.
histograms
histograms
New contributor
New contributor
edited 4 hours ago
m_goldberg
91.1k8 gold badges75 silver badges205 bronze badges
91.1k8 gold badges75 silver badges205 bronze badges
New contributor
asked 9 hours ago
user67131user67131
182 bronze badges
182 bronze badges
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
SeedRandom[1]
data = Transpose[RandomReal[10, 100], Normalize @ RandomReal[1, 100]];
Try WeightedData
:
wd = WeightedData @@ Transpose[data]
SmoothHistogram[wd]
Compare with SmoothHistogram
of data without the weights:
SmoothHistogram[data[[All,1]]]
$endgroup$
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
add a comment |
Your Answer
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
);
);
user67131 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f204345%2fweighted-smooth-histogram%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
SeedRandom[1]
data = Transpose[RandomReal[10, 100], Normalize @ RandomReal[1, 100]];
Try WeightedData
:
wd = WeightedData @@ Transpose[data]
SmoothHistogram[wd]
Compare with SmoothHistogram
of data without the weights:
SmoothHistogram[data[[All,1]]]
$endgroup$
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
add a comment |
$begingroup$
SeedRandom[1]
data = Transpose[RandomReal[10, 100], Normalize @ RandomReal[1, 100]];
Try WeightedData
:
wd = WeightedData @@ Transpose[data]
SmoothHistogram[wd]
Compare with SmoothHistogram
of data without the weights:
SmoothHistogram[data[[All,1]]]
$endgroup$
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
add a comment |
$begingroup$
SeedRandom[1]
data = Transpose[RandomReal[10, 100], Normalize @ RandomReal[1, 100]];
Try WeightedData
:
wd = WeightedData @@ Transpose[data]
SmoothHistogram[wd]
Compare with SmoothHistogram
of data without the weights:
SmoothHistogram[data[[All,1]]]
$endgroup$
SeedRandom[1]
data = Transpose[RandomReal[10, 100], Normalize @ RandomReal[1, 100]];
Try WeightedData
:
wd = WeightedData @@ Transpose[data]
SmoothHistogram[wd]
Compare with SmoothHistogram
of data without the weights:
SmoothHistogram[data[[All,1]]]
edited 7 hours ago
answered 8 hours ago
kglrkglr
213k10 gold badges244 silver badges488 bronze badges
213k10 gold badges244 silver badges488 bronze badges
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
add a comment |
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
1
1
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
This completely and succinctly answers my question, and includes a working example that makes it easy for me to reproduce. Thanks!
$endgroup$
– user67131
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
$begingroup$
@user67131, my pleasure. Thank you for the accept. And welcome to mma.se.
$endgroup$
– kglr
7 hours ago
add a comment |
user67131 is a new contributor. Be nice, and check out our Code of Conduct.
user67131 is a new contributor. Be nice, and check out our Code of Conduct.
user67131 is a new contributor. Be nice, and check out our Code of Conduct.
user67131 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f204345%2fweighted-smooth-histogram%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