'How do I check if my (x,y) are gaussian sampled?
I want to get (x,y) of 100 particles (x and y being initial conditions) sampled from a 2D gaussian where the 2-D gaussian is a product of two 1-D Gaussians so that (x,y) corresponds to a point on the surface of a 3D gaussian figure.
I did the following for that:
"r"
mu=np.random.uniform(0,1,10000)
r=[sqrt(-2*log(1-i)) for i in mu]
"theta"
eta=np.random.uniform(0,1,10000)
theta=2*pi*eta;
cuz=[cos(i) for i in theta]
suz=[sin(i) for i in theta]
"initial conditions"
Zinitial=[a*b for a,b in zip(r,cuz)];
Pinitial=[a*b for a,b in zip(r,suz)];
I now want to confirm whether these data points actually are gaussian sampled by drawing contour or 3-d plot.
How can I do that?
Now consider the following code: Consider the following code:
def gauss2d(mu,sigma):
x=gauss(mu,sigma);
y=gauss(mu,sigma);
return(x,y)
ic=[];
for i in range(50):
ic.append(gauss2d(0,1))
x=[x[0] for x in ic];
t=np.linspace(-2,2,50)
plt.plot(x,t)
Why doesn't it look like a gaussian curve?
My plots of this and the one I did with a different method match but both don't look like a gaussian but the plot like above.
Solution 1:[1]
You can add condition as:
const questions = useSelector(state => state.questions ? state.questions : [])
const myQuestion = questions.find(q => q.id === selectedQuestion.id);
const answers = myQuestion && myQuestion.length > 0 ? myQuestion.answers : null;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Abin Thaha |

