How to discard negative values while adopting Monte Carlo?












0














I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below --



$X_m = A_1 + B_1 times R_0 + epsilon_{me}$



Here, $R_0$ is a gaussian random variable with the parameters, $f_{R_0} sim mathcal{N}left(mu_{R_0},sigma_{R_0}right)$ and $f_{epsilon_{me}} sim mathcal{N}left(0,sigma_{me}right)$.
Also, $A_1$ and $B_1$ are deterministic integers.



Let's just presume that $X_m$ represents a physical phenomenon that must not be negative. However, while generating samples of $X_m$ I am encountering certain values which are negative.



My question is, how should I deal with the negative values? A few possibilities come in my mind --




  1. Resampling $X_m$ until a positive value is encountered, using it for simulation but considering all values while counting the total number of samples. This should ensure that the probability density function (pdf) of the sampled random variable integrates to 1.

  2. Truncating the distribution at 0 -- This can be done by setting the negatively sampled values equal to zero. This should increase the pdf at zero and eventually the distribution should integrate to one.


I hope I am clear on what I'm trying to do. Which is a better and mathematically sound method?










share|cite|improve this question






















  • "Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
    – Acccumulation
    Dec 10 '18 at 5:13










  • I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
    – Shihab Khan
    Dec 10 '18 at 6:48
















0














I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below --



$X_m = A_1 + B_1 times R_0 + epsilon_{me}$



Here, $R_0$ is a gaussian random variable with the parameters, $f_{R_0} sim mathcal{N}left(mu_{R_0},sigma_{R_0}right)$ and $f_{epsilon_{me}} sim mathcal{N}left(0,sigma_{me}right)$.
Also, $A_1$ and $B_1$ are deterministic integers.



Let's just presume that $X_m$ represents a physical phenomenon that must not be negative. However, while generating samples of $X_m$ I am encountering certain values which are negative.



My question is, how should I deal with the negative values? A few possibilities come in my mind --




  1. Resampling $X_m$ until a positive value is encountered, using it for simulation but considering all values while counting the total number of samples. This should ensure that the probability density function (pdf) of the sampled random variable integrates to 1.

  2. Truncating the distribution at 0 -- This can be done by setting the negatively sampled values equal to zero. This should increase the pdf at zero and eventually the distribution should integrate to one.


I hope I am clear on what I'm trying to do. Which is a better and mathematically sound method?










share|cite|improve this question






















  • "Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
    – Acccumulation
    Dec 10 '18 at 5:13










  • I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
    – Shihab Khan
    Dec 10 '18 at 6:48














0












0








0







I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below --



$X_m = A_1 + B_1 times R_0 + epsilon_{me}$



Here, $R_0$ is a gaussian random variable with the parameters, $f_{R_0} sim mathcal{N}left(mu_{R_0},sigma_{R_0}right)$ and $f_{epsilon_{me}} sim mathcal{N}left(0,sigma_{me}right)$.
Also, $A_1$ and $B_1$ are deterministic integers.



Let's just presume that $X_m$ represents a physical phenomenon that must not be negative. However, while generating samples of $X_m$ I am encountering certain values which are negative.



My question is, how should I deal with the negative values? A few possibilities come in my mind --




  1. Resampling $X_m$ until a positive value is encountered, using it for simulation but considering all values while counting the total number of samples. This should ensure that the probability density function (pdf) of the sampled random variable integrates to 1.

  2. Truncating the distribution at 0 -- This can be done by setting the negatively sampled values equal to zero. This should increase the pdf at zero and eventually the distribution should integrate to one.


I hope I am clear on what I'm trying to do. Which is a better and mathematically sound method?










share|cite|improve this question













I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below --



$X_m = A_1 + B_1 times R_0 + epsilon_{me}$



Here, $R_0$ is a gaussian random variable with the parameters, $f_{R_0} sim mathcal{N}left(mu_{R_0},sigma_{R_0}right)$ and $f_{epsilon_{me}} sim mathcal{N}left(0,sigma_{me}right)$.
Also, $A_1$ and $B_1$ are deterministic integers.



Let's just presume that $X_m$ represents a physical phenomenon that must not be negative. However, while generating samples of $X_m$ I am encountering certain values which are negative.



My question is, how should I deal with the negative values? A few possibilities come in my mind --




  1. Resampling $X_m$ until a positive value is encountered, using it for simulation but considering all values while counting the total number of samples. This should ensure that the probability density function (pdf) of the sampled random variable integrates to 1.

  2. Truncating the distribution at 0 -- This can be done by setting the negatively sampled values equal to zero. This should increase the pdf at zero and eventually the distribution should integrate to one.


I hope I am clear on what I'm trying to do. Which is a better and mathematically sound method?







normal-distribution monte-carlo simulation






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 10 '18 at 5:02









Shihab Khan

104




104












  • "Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
    – Acccumulation
    Dec 10 '18 at 5:13










  • I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
    – Shihab Khan
    Dec 10 '18 at 6:48


















  • "Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
    – Acccumulation
    Dec 10 '18 at 5:13










  • I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
    – Shihab Khan
    Dec 10 '18 at 6:48
















"Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
– Acccumulation
Dec 10 '18 at 5:13




"Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling.
– Acccumulation
Dec 10 '18 at 5:13












I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
– Shihab Khan
Dec 10 '18 at 6:48




I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it?
– Shihab Khan
Dec 10 '18 at 6:48










1 Answer
1






active

oldest

votes


















0














Truncating the distribution is not generally a good idea, for the reason you mentioned.



Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.

A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.

It is clear that no points inside the circle will get any advantage : no bias is introduced.



More generally, if $f(x)$ is the distribution before resampling, $g(x) = lambda f(x) I(x)$ is the distribution after resampling, where $I(x)$ insure that $x$ belongs to the wanted set ($I(x) = 0$ outside the set, $1$ inside) and where $lambda$ is a term insuring that integration of $g(x)$ is equal to $1$, i.e. insuring that $g(x)$ is a distribution.
$lambda$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.

You don't need to calculate $lambda$ explicitly in the generation process.



In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $1$: it is insured by the process itself.






share|cite|improve this answer





















  • If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
    – Shihab Khan
    Dec 12 '18 at 9:44










  • It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
    – Damien
    Dec 12 '18 at 11:05











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%2f3033473%2fhow-to-discard-negative-values-while-adopting-monte-carlo%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









0














Truncating the distribution is not generally a good idea, for the reason you mentioned.



Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.

A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.

It is clear that no points inside the circle will get any advantage : no bias is introduced.



More generally, if $f(x)$ is the distribution before resampling, $g(x) = lambda f(x) I(x)$ is the distribution after resampling, where $I(x)$ insure that $x$ belongs to the wanted set ($I(x) = 0$ outside the set, $1$ inside) and where $lambda$ is a term insuring that integration of $g(x)$ is equal to $1$, i.e. insuring that $g(x)$ is a distribution.
$lambda$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.

You don't need to calculate $lambda$ explicitly in the generation process.



In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $1$: it is insured by the process itself.






share|cite|improve this answer





















  • If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
    – Shihab Khan
    Dec 12 '18 at 9:44










  • It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
    – Damien
    Dec 12 '18 at 11:05
















0














Truncating the distribution is not generally a good idea, for the reason you mentioned.



Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.

A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.

It is clear that no points inside the circle will get any advantage : no bias is introduced.



More generally, if $f(x)$ is the distribution before resampling, $g(x) = lambda f(x) I(x)$ is the distribution after resampling, where $I(x)$ insure that $x$ belongs to the wanted set ($I(x) = 0$ outside the set, $1$ inside) and where $lambda$ is a term insuring that integration of $g(x)$ is equal to $1$, i.e. insuring that $g(x)$ is a distribution.
$lambda$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.

You don't need to calculate $lambda$ explicitly in the generation process.



In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $1$: it is insured by the process itself.






share|cite|improve this answer





















  • If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
    – Shihab Khan
    Dec 12 '18 at 9:44










  • It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
    – Damien
    Dec 12 '18 at 11:05














0












0








0






Truncating the distribution is not generally a good idea, for the reason you mentioned.



Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.

A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.

It is clear that no points inside the circle will get any advantage : no bias is introduced.



More generally, if $f(x)$ is the distribution before resampling, $g(x) = lambda f(x) I(x)$ is the distribution after resampling, where $I(x)$ insure that $x$ belongs to the wanted set ($I(x) = 0$ outside the set, $1$ inside) and where $lambda$ is a term insuring that integration of $g(x)$ is equal to $1$, i.e. insuring that $g(x)$ is a distribution.
$lambda$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.

You don't need to calculate $lambda$ explicitly in the generation process.



In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $1$: it is insured by the process itself.






share|cite|improve this answer












Truncating the distribution is not generally a good idea, for the reason you mentioned.



Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.

A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.

It is clear that no points inside the circle will get any advantage : no bias is introduced.



More generally, if $f(x)$ is the distribution before resampling, $g(x) = lambda f(x) I(x)$ is the distribution after resampling, where $I(x)$ insure that $x$ belongs to the wanted set ($I(x) = 0$ outside the set, $1$ inside) and where $lambda$ is a term insuring that integration of $g(x)$ is equal to $1$, i.e. insuring that $g(x)$ is a distribution.
$lambda$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.

You don't need to calculate $lambda$ explicitly in the generation process.



In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $1$: it is insured by the process itself.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Dec 10 '18 at 8:59









Damien

44514




44514












  • If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
    – Shihab Khan
    Dec 12 '18 at 9:44










  • It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
    – Damien
    Dec 12 '18 at 11:05


















  • If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
    – Shihab Khan
    Dec 12 '18 at 9:44










  • It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
    – Damien
    Dec 12 '18 at 11:05
















If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
– Shihab Khan
Dec 12 '18 at 9:44




If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it?
– Shihab Khan
Dec 12 '18 at 9:44












It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
– Damien
Dec 12 '18 at 11:05




It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected
– Damien
Dec 12 '18 at 11:05


















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%2f3033473%2fhow-to-discard-negative-values-while-adopting-monte-carlo%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

Bressuire

Cabo Verde

Gyllenstierna