I would like to create a list of Cauchy distribution pdf's, having different locations of their maxima, and being multiplied by different factors; then I'd like to calculate those functions' values for different values of x
.
I have searched on the Internet and tried various things, and I seem to be able to set up the list, but then I fail miserably when it comes to actually using the functions on arguments.
Here's some code:
pos = RandomReal[10,2]
factors = RandomInteger[{1,5},{2}]
gamma1 = 0.5
peaks = Table[factors[[i]]*PDF[CauchyDistribution[pos[[i]],gamma1],x], {i,1,2}]
Print[ peaks ]
Print[ peaks[0.1][[1]] ]
This gives me
SetDelayed::noval: Symbol peaks in part assignment does not have an immediate value.
SetDelayed::noval: Symbol peaks in part assignment does not have an immediate value.
{3.183098861837907/(1 + 4.*(-6.1318667717670134 + x)^2), 0.6366197723675814/(1 + 4.*(-1.3741656250222944 + x)^2)}
0.1
How can I use each element of my array peaks
like an individual function?
(I'm an absolute Mathematica-beginner, so in advance: sorry for the noob-question...)