-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain-sequence.stan
More file actions
32 lines (25 loc) · 775 Bytes
/
Copy pathmain-sequence.stan
File metadata and controls
32 lines (25 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
data {
int Nobs; /* Number of observations */
real logLobs[Nobs]; /* natural log of luminosity observed. */
real sigma_logL[Nobs]; /* Uncertainty on each measurement. */
real Tobs[Nobs]; /* Observed temperature. */
real sigma_Tobs[Nobs]; /* Temperature uncertainty */
}
parameters {
real<lower=0,upper=15> beta; /* Power-law slope L = T^beta */
real<lower=0.8, upper=3>Ttrue[Nobs]; /* True temperature */
}
transformed parameters {
real Ltrue[Nobs];
real logLtrue[Nobs];
for (i in 1:Nobs) {
Ltrue[i] = Ttrue[i]^beta;
logLtrue[i] = log(Ltrue[i]);
}
}
model {
/* Uniform prior on beta between limits. */
/* Uniform prior on temperature between limits. */
Tobs ~ normal(Ttrue, sigma_Tobs);
logLobs ~ normal(logLtrue, sigma_logL);
}