Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Maximum Problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46276] Re: Maximum Problem
  • From: "Curt Fischer" <crf3 at po.cwru.edu>
  • Date: Fri, 13 Feb 2004 02:28:45 -0500 (EST)
  • References: <c0fsdd$c2t$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"sabbri" <sabrinacasagrande at hotmail.com> wrote in message
news:c0fsdd$c2t$1 at smc.vnet.net...
> I have to maximize a function (the Likelihood function) in order to
> obtain the estimators of two parameter (say B e S). So I think I need
> to derive the function,(first respect to B, then respect to S) and
> equalize the 2 derivatives to zero. In other words I give the command:
> DSolve[{D[L[x,y],B]==0,D[L[x,y],S]==0},B,s]
> but Mathematica doesn't run. Where do I make mistakes? Perhaps I need
> to define the function L[x,y,B,S]??

I assume that by "derive" you mean "take the derivative of".  In that case,
yes, you need to define the functional dependence of your likelihood
function on the parameters you want to fit.

Also, you are taking the derivative and setting it equal to zero.  You want
to solve the resulting algebraic equation for the parameters.  The equation
does not involve the derivative of unknown functions, so you should use
Solve (or perhaps FindRoot), not DSolve.

In[47]:=
ymodel[x_,m_,b_]:=m x + b

In[48]:=
ydata[x_]:=(10+Random[]) x +11

In[49]:=
sse[m_,b_]:=Sum[(ymodel[x,m,b]-ydata[x])^2,{x,0,10}]

In[53]:=
Solve[{D[sse[m,b],b]\[Equal]0,D[sse[m,b],m]\[Equal]0},{m,b}]

Out[53]=
{{m -> 10.2223, b -> 13.0053}}


  • Prev by Date: Re: how to plot with logarithmic scale on X-axis ?
  • Next by Date: Re: how to plot with logarithmic scale on X-axis ?
  • Previous by thread: Re: Maximum Problem
  • Next by thread: Re: how to explain this weird effect? Integrate