Hi, I would like to carry out a L1-constrained least squared estimate, something like following equation:

I’ve tried following codes, but failed to generate HMC samples.

```
functions {
}
data {
int<lower=1> N; // total number of observations
vector[N] Y; // response variable
int<lower=1> K; // number of population-level effects
matrix[N,K] X; // population-level design matrix
}
transformed data {
}
parameters {
vector[K] w_signed; // population-level effects
}
transformed parameters {
vector[K] w;
real<lower=0, upper=1> w_limit;
for(k in 1:K) {
w[k] = fabs(w_signed[k]);
}
w_limit = sum(w);
}
model {
vector[N] squared_error;
for (n in 1:N){
squared_error[n] = (Y[n] - X[n] * w)^2 ;
}
target += -sum(squared_error);
}
generated quantities {
}
```

I’ve got following error message

“Rejecting initial value:

Error evaluating the log probability at the initial value.

Exception: validate transformed params: w_limit is 15.1066, but must be less than or equal to 1 (in ‘model35f645629433b_synth_ConstrainedLeastSquare_woV’ at line 18)”

Any suggestions?