Hello,
I want to use MLE to estimate theta for Inverse hyperbolic sine transformation in case of median regression. From Pence 2006, the likelihood function is:

As of now, my code gives an error: could not calculate numerical derivatives -- discontinuous region with missing values encountered. Here is my code
Any help to fix this would be appreciated!
I want to use MLE to estimate theta for Inverse hyperbolic sine transformation in case of median regression. From Pence 2006, the likelihood function is:
As of now, my code gives an error: could not calculate numerical derivatives -- discontinuous region with missing values encountered. Here is my code
Code:
sysuse auto.dta cap program drop mylf
program define mylf
args lnf mu sigma theta
local y asinh(`theta' * $ML_y) / `theta'
quietly replace `lnf' = -ln(2/_N) - ln(abs((normalden((`y' - `mu')/`sigma')) - ln(`sigma'))) - 1 - (1/2)*ln(1+(($ML_y)^2) * ((`theta')^2))
end
reg price mpg rep78 headroom trunk matrix b=e(b)
matrix b=b,0
ml model lf mylf ( price = mpg rep78 headroom trunk)(sigma:)(theta:) ml check
ml max
Any help to fix this would be appreciated!
