Plotting a Probability distribution with varying parameter
Suppose I wish to plot the function
import numpy as np
var('a,y')
A=np.linspace(-1,1,10)
for a in A:
z=a+x-(e^(-y^2/2))/sqrt((2*pi))
plot3d(z,(x,-1,1),(y,-1,1))
That is, I wish to plot the function z
over a range of a
. Actually the original function was z=a+x
. But, in order to introduce randomization, I changed the variable x
to x-y'
, where y'
is the standard normal variable. I wish to obtain the plot of z
as a kind of variable probability distribution over the grid of x
and y
with the variation of a
(so kind of series of probability distributions overlapping each other). How do I do this? Any hints? Thanks beforehand.
What ou aim to do is quite unclear. Could you try to explain it algebrically ?
@EmmanuelCharpentier The accepted answer is exactly what I wanted to do.