## 76 Reputation

17 years, 101 days

## driving me crazy...

This is the sort of thing that drives me crazy.

My actual code has lower case pi--when it pasted in, Maple or the list made it Pi.

Her'es what I've taken from my ascii editor

eq := p0+p1+p2+p3+p4+p5 = pi11,
p8+p9 = sigma11,
p6+p7 = pi10,
p10+p11 = sigma10,
p0+p1 = pi01,
p3+p8 = sigma01,
p2+p6 = pi00,
p4+p5+p7+p9+p10+p11 = sigma00,
p3 = 0,
p5 = 0,
p7 = 0,
p0+p1+p2+p3+p4+p5+p6+p7+p8+p9+p10+p11 = 1;

sol1 := solve({eq},{p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11});

I still get the same thing.

## This is very interesting,...

This is very interesting, though I'm not sure quite what the reference to the tag means in Robert's note.

This was my initial foray into Maple for teaching statistics to graduate students.

you've convinced me that I need to make a greater effort.  I'd like to find a good book that would help me.  Any recommendations???

I see this book on amazon

 Author Cyganowski, Sasha. Title From elementary probability to stochastic differential equations with Maple / Sasha Cyganowski, Peter Kloeden, Jerzy Ombach

thanks!

## ok, here's the actual problem...

you folks have been so helpful.

I can see I should have just given you guys the real problem.  Here it is

f(a,b):=c*ln((exp(a))/(1+exp(a)))+d*ln(1-(exp(a))/(1+exp(a)))+e*ln((exp(a+b))/(1+exp(a+b)))+f*ln(1-(exp(a+b))/(1+exp(a+b)));

this is a likelihood function.  I take the two first derivatives

foc1 := simplify(diff(f(a, b), a));

foc2 := simplify(diff(f(a, b), a));

and want to set them to zero and solve for a, b.  these are the first-order conditions.

solve([foc1 = 0, foc2 = 0], [a, b]);

Everything works just fine.

now, the foc are a function of p1 and p2, and I want those pulled terms pulled out

p1=exp(a)/1+exp(a)

and

p2=exp(a+b)/(1+exp(a+b))

the key is that I want the first order conditions expressed as functions of p1 and p2.   There is some intution to the FOC that I want to illustrate to my students.

suggestions?

## simplify with the side...

simplify with the side condition looks promising, but what I left out one

What if the problem were that I wanted to transform

e^{3x+3}+2

into

a ^3 +2

where a=e^x+1

simplify(e^{3x+3}+2,{a=e^x+1}}

as you could likely anticipate, this generates an error

> simplify(exp^(3*x+3)+2, {exp^(x+1) = a});
%;
Error, (in simplify/siderels:-simplify/siderels) side relations must be polynomials in (name or function) variables

 Page 1 of 1
﻿