Maximum Likelihood Fit for Non-Linear Regression I am reading the blog on Bayesian priors and overfitting and it mentions that assume that a data is generated by the following function:
$$y_t=\sin\left(\dfrac{x_t}{10}\right)+ \cos\left(z_t\right)+5d_t+4+\epsilon_t$$
Then it mentiones the following:

It features a cyclic process with one event represented by the variable $\mathbf{d}$. There is only 1 observation of that event so it means that maximum likelihood will always assign everything to this variable that cannot be explained by other data.

I did not understand what is meant by this whole sentence. So essentially we are generating $y_t$ by recording the values such as $x_t, z_t,d_t,\epsilon_t$ overtime and then plotting the $y$ vs $t$ right? now does that statement mean that we only have a single value recorded for d? And what does MLE will assign everything to this variable that cannot be explained by other data mean?
I would appreciate if a concrete formulation of MLE can be provided for the equation above as the original author did not provide any in the post. 
 A: Okay. I didn't understand that you were referring to that model specifically. Normally, to calculate the likelihood of a model, you calculate the residuals and then plug them into the concentrated likelihood ( concentrated just means that you get rid of the $\hat{\sigma}^2$ part of the likelihood by substituting whatever the MLE is for $\sigma^2$ ). But, assuming the residuals are normally distributed,  we can cheat a little and just minimize $\sum_{i=1}^{n} \hat{\epsilon_t}^2$. ( this is the same as maximizing the likelihood but it only works because you have the normal as the density ).  
A) Now,  Assuming I understand what the blogger is doing ( which could be a big assumption ) your model is:
$y_t = sin(\frac{x_t}{10}) + cos(z_t) + \beta \times d_t + 4 + \epsilon_t$.
Note that the only unknown parameter in your model is $\beta$.
So, $\hat{\epsilon}_t = y_t - (sin(\frac{x_t}{10}) + cos(z_t) + \beta \times d_t + 4 ) $ 
For $t = 1, \ldots n$, you should have all the terms above above that allow you to calculate $\hat{\epsilon}_t ~\forall t$
So, you calculate $\hat{\epsilon}_t$ for each $t$, then sum the squares of it and minimize the sum. Notice that the sum of the residuals squared is a function of $\beta$ and nothing else so what you're really doing is finding the $\hat\beta$ that minimizes the sum of the residuals squared. This is done using an iterative numerical procedure. Do you use R or Rcpp ? My description is general but, if you use R, then there are tons of examples on the net that show you how to implement an optimization that minimizes a function which is exactly what you're trying to do because the function is the sum of the residuals squared. Note that minimizing the sum is an iterative numerical procedure. The function optim() in R is usually used for doing this. 
B) Important point: Since the only parameter is $\beta$, your model really isn't non-linear. ( again, this is assuming I understand it ). So could turn the model into a linear regression model by just subtracting everything on the RHS from $y_t$ except for the term involving $\beta$. Specifically, let
$y^{*}_t = y_t - (sin(\frac{x_t}{10}) + cos(z_t) + 4 ) $ 
Then, the model can be written as $y^{*}_t = \beta \times d_{t} + \epsilon_t$.
But the latter is just a linear regression model which can be estimated by a call to the lm function in R. If there were coefficients in front of the sine or cosine terms, you could still use the same reformulation described in B) so, atleast as far as I understand, you really have a linear regression model and don't need to worry about non-linear regression and don't have to concern yourself with what described in A). But it still might be slightly useful to you ? 
