r density, we assume each <span class="math inline">\(\beta_i\)</span> has an independent Laplace prior distribution, with location 0 and scale 1, so that <span class="math inline">\(\log p( \beta ) = - \sum_{i=0}^d | \beta_i|\)</span>. Similar to the log-likelihood function, the log-prior density is defined as a function with input <code>params</code>. In our case the definition is</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">logPrior =<span class="st"> </span>function(p