For simulation purposes, how long samples to draw from distributions?












0














For simulation purposes, how long samples to draw from distributions?



E.g. if I want something to follow an exponential distribution with mean 25, then upon trialing in scipy I found that expon.rvs(size=10000, scale=25) seems to have its mean withint $25 pm 0.5$. I guess this could be enough in this case.



However, this means that I must use data of length 10000, even when I could do with much less (e.g. the runs I do are 1000 time units and drawing 10000 inter-arrival times means that I get much more times than I need).



Or maybe I should do:



expon.rvs(size=10000, scale=25)



and then draw as many samples I need from this?










share|cite|improve this question






















  • What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
    – Alex
    Nov 24 at 20:33












  • @Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
    – mavavilj
    Nov 24 at 20:42












  • I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
    – Alex
    Nov 24 at 20:55










  • @Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
    – mavavilj
    Nov 25 at 8:47


















0














For simulation purposes, how long samples to draw from distributions?



E.g. if I want something to follow an exponential distribution with mean 25, then upon trialing in scipy I found that expon.rvs(size=10000, scale=25) seems to have its mean withint $25 pm 0.5$. I guess this could be enough in this case.



However, this means that I must use data of length 10000, even when I could do with much less (e.g. the runs I do are 1000 time units and drawing 10000 inter-arrival times means that I get much more times than I need).



Or maybe I should do:



expon.rvs(size=10000, scale=25)



and then draw as many samples I need from this?










share|cite|improve this question






















  • What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
    – Alex
    Nov 24 at 20:33












  • @Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
    – mavavilj
    Nov 24 at 20:42












  • I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
    – Alex
    Nov 24 at 20:55










  • @Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
    – mavavilj
    Nov 25 at 8:47
















0












0








0







For simulation purposes, how long samples to draw from distributions?



E.g. if I want something to follow an exponential distribution with mean 25, then upon trialing in scipy I found that expon.rvs(size=10000, scale=25) seems to have its mean withint $25 pm 0.5$. I guess this could be enough in this case.



However, this means that I must use data of length 10000, even when I could do with much less (e.g. the runs I do are 1000 time units and drawing 10000 inter-arrival times means that I get much more times than I need).



Or maybe I should do:



expon.rvs(size=10000, scale=25)



and then draw as many samples I need from this?










share|cite|improve this question













For simulation purposes, how long samples to draw from distributions?



E.g. if I want something to follow an exponential distribution with mean 25, then upon trialing in scipy I found that expon.rvs(size=10000, scale=25) seems to have its mean withint $25 pm 0.5$. I guess this could be enough in this case.



However, this means that I must use data of length 10000, even when I could do with much less (e.g. the runs I do are 1000 time units and drawing 10000 inter-arrival times means that I get much more times than I need).



Or maybe I should do:



expon.rvs(size=10000, scale=25)



and then draw as many samples I need from this?







probability simulation






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 22 at 20:35









mavavilj

2,67511032




2,67511032












  • What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
    – Alex
    Nov 24 at 20:33












  • @Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
    – mavavilj
    Nov 24 at 20:42












  • I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
    – Alex
    Nov 24 at 20:55










  • @Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
    – mavavilj
    Nov 25 at 8:47




















  • What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
    – Alex
    Nov 24 at 20:33












  • @Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
    – mavavilj
    Nov 24 at 20:42












  • I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
    – Alex
    Nov 24 at 20:55










  • @Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
    – mavavilj
    Nov 25 at 8:47


















What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
– Alex
Nov 24 at 20:33






What do you mean by "simulation purposes"? The number of samples needed will depend on your application - e.g. if you needed to estimate the mean of $log(X)$, where $X$ is some distribution, the number of simulations needed would depend on how accurate you needed your estimate to be.
– Alex
Nov 24 at 20:33














@Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
– mavavilj
Nov 24 at 20:42






@Alex Perhaps my idea was regarding that if one only needs, say, 20 rvs, then simulating 10000 only in order to meet accuracy in some CLT sense is waste of computation power. Since technically one could simulate only 20 rvs that obey the required params? Or is this not possible? If one truncates the domain of the generating function? So rather than drawing from all $mathbb{R}$, draw only from, say, $[2,5]$?
– mavavilj
Nov 24 at 20:42














I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
– Alex
Nov 24 at 20:55




I'm not sure I understand, but I agree that if you only need 20 RVs then simulating more than that is a waste. If you want a sample from a region, e.g. [2, 5] then you can use rejection sampling: keep drawing from the entire distribution but only keep the observations that fall in the region/interval that you want samples from.
– Alex
Nov 24 at 20:55












@Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
– mavavilj
Nov 25 at 8:47






@Alex In order to e.g. get expon.rvs(scale=25) have desired mean (25) one must take 100000 samples or so to be within $25 pm 0.2$ or so. With 100 samples the accuracy is maybe $25 pm 9$.
– mavavilj
Nov 25 at 8:47

















active

oldest

votes











Your Answer





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: "69"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3009625%2ffor-simulation-purposes-how-long-samples-to-draw-from-distributions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3009625%2ffor-simulation-purposes-how-long-samples-to-draw-from-distributions%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa