Question 7b) In the solution, while calculating the likelihood function, P(yi=1) and p(yi=0) are raised to the power yi and 1-yi respectively? Why?
here yi has been defined as a bernouli (indicator) variable ....... with Xi>0 considered to be success .... and Xi =0 considered to be failure ....... so we first define p = p (yi = 1) = p (success) = p (Xi >0) and q = p (yi = 0) = p (failure) = p (xi=0) and then write the likelihood function using the probability function of a bernouli distribution ie p ^y * q^(1-y)
because we are only interested in two outcomes ..... xi > 0 and Xi = 0 ...... we are associating success and failure to them respectively and defining a random variable yi such that yi takes 1 and 0 values corresponding to success and failure ..... we are not interested in the actual value that xi takes (which was the case in 7a) hence yi is distributed as bernouli with parameter p = p (xi>0)