Type the following in R, set.seed (300) x = rmultinom(1e3, size=20,prob=c(.25,.5,.25)) You now have a 3 x 10' matrix of
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Type the following in R, set.seed (300) x = rmultinom(1e3, size=20,prob=c(.25,.5,.25)) You now have a 3 x 10' matrix of
Type the following in R, set.seed (300) x = rmultinom(1e3, size=20,prob=c(.25,.5,.25)) You now have a 3 x 10' matrix of samples from a multinomial distribution. The n-th col of the matrix corresponds to an n-th sample, which is a triple (i,j,k) of integers which sum to 20. Suppose you were given the data and you assumed that it is distributed as a Multinomial(20,p) where p = (P1, P2, P3) with PL + P2 + p = 1. You want to find the best estimate for these parameter values. Use maximum likelihood estimate to determine what p is equal to. Say your initial guess is p = 0.33, 33, 33). Now run the method of steepest descent algorithm (optim) to determine p. In the box below only input the value p2.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!