model {
# No noise spline in space time
  for (i in 1:n_obs) {
   # Main likelihood
    y[i] ~ dnorm(mu_y[i], sigmasq_all[i]^-1)
    sigmasq_all[i] <- sigma_y^2 + y_err[i]^2

    # Mean structure
    mu_y[i] <- l[i]
  }

  # Non-linear local component
   l <- B_st %*% b_st
   for (j in 1:n_knots_st) {
      b_st[j] ~ dnorm(0, sigma_beta^-2)
   }

  # Priors
  sigma_beta ~ dt(0, 1^-2, 1)T(0,)
  sigma_y ~ dt(0, 1^-2, 1)T(0,)


  }
