I have a nonlinear model: Y = B_0 + B_1*(x_1) + ((B_1)^2)*(x_2) + (B_0)*(B_1)*((x_3)^2) + (B_2)*(x_4)+ e.

Using this nonlinear model I produce data using specified values fo B_0, B_1 and B_2. The error term is normally distributed and creates the random variation in my sample data.
All x_i values (i = 1,2,3, 4) are uniformly distributed (0,20).

I want to find the maximum likelihood estimates for B_0, B_1 and B_2.

I have been struggling to try to figure out how to do this. I have been trying to follow Gould, Pitblado and Poi's guide but I'm having trouble writing a program for the variables that follow the normal distribution.

I know that my likelihood function will be dependent on an indicator function and I am not sure how to incorporate this into a program that will work for all my variables.

Any help or guidance would be much appreciated.