Re: Question from newbabie
- To: mathgroup at smc.vnet.net
- Subject: [mg33873] Re: [mg33831] Question from newbabie
- From: BobHanlon at aol.com
- Date: Sun, 21 Apr 2002 06:12:19 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 4/19/02 3:44:44 AM, antispam at antispam.org writes: >Hi... I am new to Mathematica, so please forgive me if this question >is naive. > >Can you tell me how can I do the following? > >Differentiate the log likelihood for multi-variate Gaussian with >respect to the covariance matrix, and then solve the log-likelihood >equation.. > >I know how to do that manually, but I would like to learn how to >do that in Mathematica. Thank you. Needs["Statistics`MultinormalDistribution`"]; dist = MultinormalDistribution[{m1,m2}, {{1,r},{r,1}}]; data=RandomArray[ dist /. {m1->3, m2->5, r->1/2},{100}]; eqn= (D[Tr[PowerExpand[Log[ PDF[dist, {#[[1]],#[[2]]}]]]& /@ data], #]& /@ {m1,m2,r})==0; FindRoot[eqn, {m1,1},{m2,1},{r,.1}] {m1 -> 2.91689, m2 -> 5.02367, r -> 0.571814} Bob Hanlon Chantilly, VA USA