cov_exp_quad(x, signal_variance, length_scale)data {
int<lower=1> N;
int<lower=1> D;
int<lower=1> N_pred;
vector[N] y;
vector[D] x[N];
vector[D] x_pred[N_pred];
}
parameters {
real<lower=1e-12> length_scale;
real<lower=0> alpha;
real<lower=1e-12> sigma;
vector[N] eta;
}
transformed parameters {
vector[N] f;
{
matrix[N, N] L_cov;
matrix[N, N] cov;
cov = cov_exp_quad(x, alpha, length_scale);
for (n in 1:N)
cov[n, n] = cov[n, n] + 1e-12;
L_cov = cholesky_decompose(cov);
f = L_cov * eta;
}
}
model {
length_scale ~ student_t(4,0,1); # (df, mean, sd)
alpha ~ normal(0, 1);
sigma ~ normal(0, 1);
eta ~ normal(0, 1);
y ~ normal(f, sigma);
}One of the reasons for asking is that I want to get a different length_scale parameter for each explanatory variable (x) or each dimension. So that I can test the relevance of each dimension.
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Daniel,
On Sunday, March 19, 2017 at 5:26:25 AM UTC+2, Daniel Emaasit wrote:I would like to get some insight into which kernel this Stan function below representscov_exp_quad(x, signal_variance, length_scale)Stan reference manual https://github.com/stan-dev/stan/releases/download/v2.14.0/stan-reference-2.14.0.pdfpage 458 says it's this one, that is, one length scale for all dimensions. The version where lengthscale can be a vector/array is coming.
Aki, could you point me to the GitHub branch for this version so I can experiment with it.