MathGroup Archive 2006

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

Search the Archive

Re: problems with Nmaximization

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67828] Re: [mg67815] problems with Nmaximization
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 9 Jul 2006 04:51:03 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

m={75,36,12,4,2,0,0,0,0};

n={571-75,338-36,173-12,93-4,41-2,21,10,6,4};

t=Range[0,Length[m]-1];

s=Simplify[Total[
      m*Log[(h*p*(1-p)^t)/(1-h+h*(1-p)^t)]-
        n*Log[1-(h*p*(1-p)^t)/(1-h+h*(1-p)^t)]]]

eps=10^-6;

Plot3D[s, {h, eps, 1-eps}, {p, eps, 1-eps}];

Limit[Limit[s, h -> 1], p -> 1]

Infinity


Bob Hanlon

---- narsi <narasimhan.sowmyanarayanan at gmail.com> wrote: 
> I am trying to use nmax to evaluate a function using Nmaximize. The
> function is as follows.
> 
> \!\(m[1] = 75\[IndentingNewLine]
>   m[2] = 36\[IndentingNewLine]
>   m[3] = 12\[IndentingNewLine]
>   m[4] = 4\[IndentingNewLine]
>   m[5] = 2\[IndentingNewLine]
>   m[6] = 0\[IndentingNewLine]
>   m[7] = 0\[IndentingNewLine]
>   m[8] = 0\[IndentingNewLine]
>   m[9] = 0\[IndentingNewLine]
>   n[1] = 571 - 75\[IndentingNewLine]
>   n[2] = 338 - 36\[IndentingNewLine]
>   n[3] = 173 - 12\[IndentingNewLine]
>   n[4] = 93 - 4\[IndentingNewLine]
>   n[5] = 41 - 2\[IndentingNewLine]
>   n[6] = 21\[IndentingNewLine]
>   n[7] = 10\[IndentingNewLine]
>   n[8] = 6\[IndentingNewLine]
>   n[9] = 4\[IndentingNewLine]\[IndentingNewLine]
>   NMaximize[{âË?â??\+\(t = 1\)\%9\((m[
>   t]*Log[\((\(h\ *p*\((1 -
>       p)\)\^\((t - 1)\)\)\/\(1 - h + h*\((1 - p)\)\^\((t - 1)\)\))\)] -
>      n[t]*Log[1 - \((\(h\ *p*\((1 - p)\)\^\((t - 1)\)\)\/\(1 - h +
>    h*\((1 - p)\)\^\((t - 1)\)\))\)])\), 1 � h � 0, 1 � p � 0},
> {h, p}]\)
> 
> I cannot get this to converge. It gives me the following message
> 
> \!\(ower::"infy" \(\(:\)\(\ \)\) "
>     Infinite expression \!\(1\/0.`\) encountered"\)
> 
> 
> Can someone please help with this error in mathematica. I dont know
> what the problem is. 
> 
> Thanks
> 
> narsi
> 


  • Prev by Date: Re: ReplacePart in an If[] construct?
  • Next by Date: Re: ReplacePart in an If[] construct?
  • Previous by thread: Re: problems with Nmaximization
  • Next by thread: ReplacePart in an If[] construct?