-3

In the following case I'm very confused as to why there is a lam in front of the expression in line 3. Could someone please clarify what this lambda does?

lam = 0.5
x = np.arange(0, 15, 0.1)
y = lam * np.exp(-lam * x) 
Yu Hao
  • 119,891
  • 44
  • 235
  • 294
bugsyb
  • 5,662
  • 7
  • 31
  • 47

2 Answers2

2

It's the coefficient of the probability density function of the exponential distribution.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
1

It's lam, not lambda. Since the first line is lam = 0.5, lam * np.exp(-lam * x) is multiplying the result of np.exp(-lam * x) by 0.5.

user2357112
  • 260,549
  • 28
  • 431
  • 505