3
$\begingroup$

I want to write an equation in such a manner that (if possible) it is written as some variable function of desired variables. For example to check whether a statistic is a sufficient statistic or not we check the interaction of a parameter with the data only through the function of data.

For instance, in the following, I could write the R.H.S as $\lambda$ interacting only with $(x+y).$ Is it possible to do that in Mathematica?

$\left(e^{\lambda } (p-1) (c \lambda )^x-p e^{c \lambda } \lambda ^x\right)\left(e^{\lambda } (p-1) (c \lambda )^y-p e^{c \lambda } \lambda ^y\right) \\ = e^{2c\lambda}p^2\lambda^{(x+y)}+e^{-2c\lambda+\lambda}(1-p)p c^{y}\lambda^{(x+y)}+ e^{\lambda-c\lambda}(1-p)c^xp\lambda^{(x+y)}+e^{2\lambda}(1-p)^{2}c^{(x+y)}\lambda^{(x+y)} $

(-E^(c \[Lambda]) p \[Lambda]^x + 
   E^\[Lambda] (-1 + p) (c \[Lambda])^
    x) (-E^(c \[Lambda]) p \[Lambda]^y + 
   E^\[Lambda] (-1 + p) (c \[Lambda])^y)
$\endgroup$

1 Answer 1

3
$\begingroup$

λ interacting only with (x+y)

Is this what you mean?

eq=(-E^(c λ) p λ^x+E^λ (-1+p) (c λ)^x) (-E^(c λ) p λ^y+E^λ (-1+p) (c λ)^y)
Simplify[Collect[PowerExpand[eq],λ^(x+y)]]

$$ \lambda ^{x+y} \left(e^{\lambda } (p-1) c^x-p e^{c \lambda }\right) \left(e^{\lambda } (p-1) c^y-p e^{c \lambda }\right) $$

$\endgroup$
2
  • $\begingroup$ you mean eq instead of exp1 in above code. $\endgroup$
    – kaka
    Commented Dec 25, 2017 at 20:57
  • $\begingroup$ @kaka thanks. Fixed typo $\endgroup$
    – Nasser
    Commented Dec 25, 2017 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.