I have been trying to estimate the MLE for my joint posterior. I'm using R and the package stats4. I have 14 parameters and two of them are $\geq 0$, which I did not know how to implement (and I was creating NaN due to the minus log posterior required in for the mle function) and I just made it return very high value (1000) if either of the parameters were negative. Is this the right way to solve this problem? As I was forced to change my prior each time (because MLE told me that my prior estimates were way to high) and I find these nonnegative parameters going down to were low numbers (0.001 and 0.01) which did not seem right and at each iteration way below my suggested prior. Also, since I didn't have the exact posterior due to the structure of the model and I tried to scale it such that the point estimate from the mle function plugged in the log joint posterior had the value 0. Is this approximation okay for this function?