How to increase the acceptance ratio

In summary, we are discussing how to generate a random distribution that is exponentially distributed with a desired mean. This can be achieved by using a linear function to improve the acceptance ratio and create a distribution like the desired one. However, the question is related to a homework assignment and should be posted in the appropriate forum. Additionally, we note that a flat distribution of F yields a distribution like the desired one when F' = f.
  • #1
Othman0111
27
0
I trying to generate a random distribution

λe-λy
Which distributed exponentially.
Python:
%matplotlib inline
import numpy as np
from matplotlib import pyplot

N = 1000
r = np.random.random(N)

xlambda = 0.1
x = -np.log(r)/xlambda

binwidth=xlambda*5
pyplot.hist(x,bins=np.arange(0.,100., binwidth),density=True);
pyplot.plot(np.arange(0.,100.,binwidth),xlambda*np.exp(-xlambda*np.arange(0.,100.,binwidth)),ls='-',c='red',lw=3);N = 10000

xmax = 100
ymax = xlambda

rx = np.random.random(N)*xmax
ry = np.random.random(N)*ymax

values = []

Nin = 0
for i in range(N):
    if(ry[i] <= xlambda*np.exp(-xlambda*rx[i])):
        # Accept
        values.append(rx[i])
        Nin += 1    

x = np.asarray(values)

print("Acceptance Ratio: ",Nin/float(N))

binwidth=xlambda*5
pyplot.hist(x,bins=np.arange(0.,100., binwidth),density=True);
pyplot.plot(np.arange(0.,100.,binwidth),xlambda*np.exp(-xlambda*np.arange(0.,100.,binwidth)),ls='-',c='red',lw=3);

I want to Improve the acceptance ratio by using a linear function f(x)=1-ax. is there a certain choice for a?
 
Technology news on Phys.org
  • #2
This homework ? Then please post in the homework forum.

Do you know that if ##F'=f## then a flat distribution of F yields a distribution like ##f## ?
 
  • #3
BvU said:
This homework ? Then please post in the homework forum.

Do you know that if ##F'=f## then a flat distribution of F yields a distribution like ##f## ?
I didn't get what you're saying
 
  • #4
Thread closed. There's a duplicate of the question here: https://www.physicsforums.com/threads/how-to-increase-the-acceptance-ratio-in-python.966421/
 

1. How can I improve the quality of my research to increase the acceptance ratio?

To increase the acceptance ratio, it is important to conduct high-quality research. This includes a thorough literature review, well-designed experiments, and accurate data analysis. It is also important to clearly communicate the significance and implications of your findings in your research paper.

2. Will collaborating with other researchers improve my chances of getting accepted?

Collaborating with other researchers can definitely improve your chances of getting accepted. This can bring new perspectives and expertise to your research, making it more robust and impactful. It also shows that your work has been validated by other experts in the field.

3. How important is it to choose the right journal for submission?

Choosing the right journal for your research is crucial in increasing the acceptance ratio. Make sure to target journals that are well-respected in your field and have a high acceptance rate. Also, consider the journal's scope and whether your research aligns with their focus.

4. How does the review process affect the acceptance ratio?

The review process plays a significant role in determining the acceptance ratio. It is important to respond to any comments or suggestions from reviewers in a timely and professional manner. This shows that you are willing to improve your research and increases the chances of acceptance.

5. Are there any specific formatting guidelines I should follow to increase my acceptance ratio?

Following the specific formatting guidelines of the journal you are submitting to is crucial in increasing the acceptance ratio. Make sure to carefully read and adhere to the guidelines for formatting, word count, and referencing style. This shows attention to detail and makes it easier for reviewers to evaluate your research.

Back
Top