-1

So, I recently learned about the Hellinger Distance. Now, I wanted to generate a random sample from Poisson distribution using R, and then use this to estimate $\lambda$. Now, generating a sample, and computing the relative frequencies was easy. But, I can't implement the Poisson pmf $f_\lambda(x)$, where it should have $x,\lambda$ as variables. But, I don't know how to declare that. I replaced $\lambda$ by $a$, and I tried f<-function(x){exp{-a}*a^x/factorial(x)} But it didn't work. Now, can someone tell me, how to proceed after this? Thanks.

shadow10
  • 151
  • 10

1 Answers1

2
f<-function(x,a){exp{-a}*a^x/factorial(x)}
Sycorax
  • 1,298
  • 13
  • 26