I am trying to generate samples from a Gaussian distribution, with the sample having a certain probability, but unable to figure out a way. Eg. I want a sample from $N(0, 1)$ which has a probability of $0.3$.
For context, I am trying approximate inference for a Bayesian network.
For discrete variables, I divide the real line between 0 and 1 at the intervals equal to the value of probability for each of the discrete value. $P(X=x_0)=0.35$, $P(X=x_1) =0.65$, using random number generator, if the generated number is $\le 0.35$, $X$ is instantiated to $x_0$ else to $x_1$.
Unable to figure out a way to do the same for continuous distribution.