Let $$ f(x;\theta)=\frac{1}{\pi} \frac{e^{\theta x}\cos(\theta \pi/2)}{\cosh(x)}, x\in{\mathbb{R}} $$ be a family of densities and which is clearly exponential family.
Then what is the Maximum Likelihood Estimator $\hat\theta_{n}$ of $\theta$ based on an independent sample of size $n$?
My try:
When I solved the loglikelihood equation, I got $$ \tan(\theta \pi/2)=\frac{2}{\pi}\bar{x} \hspace 4cm (*) $$
Now, my problem is, if we solve $(*)$ for $\hat\theta_{n}$ then $\hat\theta_{n}$ is not unique. But for the exponential family it should be unique, right? So, I don't understand what is going wrong here. Your help will be greatly appreciated.
The joint density is $$f(\boldsymbol x \mid \theta) = \prod_{i=1}^n \frac{e^{\theta x_i} \cos \frac{\pi}{2}\theta}{\pi \cosh x_i} = \biggl(\frac{\cos \tfrac{\pi}{2} \theta}{\pi}\biggr)^{\!n} \exp(\theta n \bar x) \prod_{i=1}^n \frac{1}{\cosh x_i}.$$ Thus the log-likelihood is $$\ell(\theta \mid \boldsymbol x) = n \log \cos \tfrac{\pi}{2}\theta - n \log \pi + n \theta \bar x - \sum_{i=1}^n \log \cosh x_i.$$ The derivative with respect to $\theta$ is $$\frac{d\ell}{d\theta} = -n \left( \frac{\pi}{2} \tan \frac{\pi}{2} \theta + \bar x\right).$$ This gives the critical point $$\hat \theta = \frac{2}{\pi} \tan^{-1} \frac{2}{\pi} \bar x.$$
Note that my previous computation was incorrect.
This is a unique MLE because the inverse tangent is taken to be in the range $(-\tfrac{\pi}{2}, \tfrac{\pi}{2})$, since we are required to have $-1 < \theta < 1$: the density is negative if $|\theta| \ge 1$. Therefore, there is exactly one $\hat \theta \in (-1,1)$ for any given $\bar x$.