Likelihood function of a streched exponential function I would very much appreciate help regarding the following problem: I want to fit a stretched exponential function to different datasets by maximum likelihood:
$$y = e^{(b_0 x^{(b_1 - 1)} + b_2)}$$
$b_0$, $b_1$ and $b_2$ denote the parameters of the function, while "$x$" and "$y$" are variables. Unfortunately, my statistical skills are not sufficient in this area: Can anyone tell me the likelihood function of this stretched exponential function?
 A: In comments you suggest the model for an observation $Y$ associated with a regressor value $x$ is the one with homoscedastic Normal errors
$$Y \sim \mathcal{N}\left(\exp\left(b_0 x^{b_1-1} + b_2\right), \sigma^2\right)$$
and that different $Y$ are independent.  Writing $b=(b_0, b_1, b_2)$ and
$$\mu(x; b) = \exp\left(b_0 x^{b_1-1} + b_2\right),\tag{1}$$
we may therefore express the probability density function (PDF) of each observation $y_i$, $i=1,\ldots, n$ as
$$f_Y(y_i; x_i) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(y_i-\mu(x_i;b))^2}{2\sigma^2}\right)$$
I'm pretty sure Stata wants you to supply the log likelihood function because in all but small problems the likelihood would underflow the IEEE double-precision floats it uses. The independence assumption implies the likelihood is the product of values of the PDF, whence its logarithm is the sum of their logarithms,
$$\eqalign{
\Lambda(y_1,\ldots,y_n; x_1,\ldots,x_n) &= \sum_{i=1}^n \log\left(\frac{1}{\sqrt{2\pi\sigma^2}}\right) - \frac{(y_i-\mu(x_i, b))^2}{2\sigma^2}\\
&=-\frac{n}{2}\log(2\pi\sigma^2) - \frac{1}{2\sigma^2}\sum_{i=1}^n (y_i-\mu(x_i, b))^2
.\tag{2}}$$
$(1)$ and $(2)$ together provide an explicit formula for $\Lambda$ as a function of $b$ and $\sigma$ (depending, of course, on the data).
Note that conditional on any value of $\sigma$, maximizing $\Lambda$ amounts to finding $b$ to minimize the sum of squares of discrepancies between the $y_i$ and $\mu(x_i;b)$ (the right-hand term).
Except for huge datasets, maximizing $\Lambda$ accurately can be a delicate computation.  You can help your software out by finding some approximate initial solutions.  Consider exploring a set of reasonable values of $b_1$ and regressing (using ordinary least squares) $\log(y)$ against $x^{b_1-1}$ to estimate the slope $b_0$ and intercept $b_2$.  Pick the solution $\hat b = (\hat b_0, \hat b_1, \hat b_2)$ with the best fit and start Stata's search at $\hat b$.  If you can, supply some bounds for these parameters so it can constrain that search.
