Skip to content

Commit

Permalink
Minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
milkha committed Feb 22, 2017
1 parent 49eaf91 commit b142df4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion splines_in_stan.Rmd
Expand Up @@ -267,7 +267,7 @@ $$
$$
The proof is simple and can be done by induction. This means that if the B-spline coefficients, $a_i = a$, are all equal, then the resulting spline is the constant function equal to $a$ all the time. In general, the closer the consecutive $a_i$ are to each other, the smoother (less wiggly) is the resulting spline curve. In other words, B-splines are local bases that form the splines; if the the coefficients of near-by B-splines are close to each other, we will have less local variability.

This motivates the use of priors enforcing smoothness across the coefficients, $a_i$. With such priors, we can choose a large number of knots and do not worry about overfitting. Here, we propose an AR(1) prior as follows:
This motivates the use of priors enforcing smoothness across the coefficients, $a_i$. With such priors, we can choose a large number of knots and do not worry about overfitting. Here, we propose a random-walk prior as follows:
$$
a_1 \sim \mathcal{N}(0,\tau) \qquad a_i\sim\mathcal{N}(a_{i-1}, \tau) \qquad \tau\sim\mathcal{N}(0,1)
$$
Expand Down
Binary file modified splines_in_stan.pdf
Binary file not shown.
Binary file modified splines_in_stan_files/figure-latex/plot_fit_basis-1.pdf
Binary file not shown.
Binary file modified splines_in_stan_files/figure-latex/plot_fit_basis_2-1.pdf
Binary file not shown.
Binary file modified splines_in_stan_files/figure-latex/plot_res-1.pdf
Binary file not shown.

0 comments on commit b142df4

Please sign in to comment.