Skip to content
BIASED

Conjugate priors and the exponential family

When the posterior has a closed form: the conjugate pairs Beta–Bernoulli, Gamma–Poisson, the Normal mean and precision, the Normal–Gamma; the exponential family, sufficient statistics and the general conjugate prior; the eight standard distributions and their moments.

When the integral takes care of itself

In the topic The Bayesian approach a coin with a uniform prior on θ\theta came up heads three times, the posterior became Beta⁡(4,1)\operatorname{Beta}(4, 1), and the next flip was predicted to be heads with probability 4/54/5. Everything there had a closed form. That was luck, not the rule. Bayes' formula

p(θ∣X)=p(X∣θ) p(θ)∫p(X∣θ′) p(θ′) dθ′p(\theta \mid X) = \frac{p(X \mid \theta)\, p(\theta)}{\int p(X \mid \theta')\, p(\theta')\, d\theta'}

has an integral in the denominator, and for most pairs of prior and likelihood nobody can take it by hand. A grid is no escape either: with GG points per axis and dd parameters it costs GdG^d evaluations, and 100100 points for 55 parameters is already 101010^{10}.

This topic is about the pairs where the integral takes care of itself.

Definition. A family of priors p(θ∣λ)p(\theta \mid \lambda) with hyperparameters λ\lambda is conjugate to a likelihood p(x∣θ)p(x \mid \theta) if, for any admissible data XX, the posterior stays in the family:

p(θ∣X,λ)=p(θ∣λ′),p(\theta \mid X, \lambda) = p(\theta \mid \lambda'),

where the new hyperparameters λ′\lambda' are computed from λ\lambda and XX.

Three remarks keep the definition honest.

  • The family is shared by the prior and the posterior only. The likelihood is a distribution over the data, often on a different space. As a function of θ\theta it just has to look like the prior, so that the product keeps the form.
  • Bayesian updating turns into arithmetic on a few numbers. The normalizer of the family is known, so the evidence and the predictive often come out in closed form too.
  • If the observations are independent given θ\theta, then p(X∣θ)=∏ip(xi∣θ)p(X \mid \theta) = \prod_i p(x_i \mid \theta). Yesterday's posterior is today's prior, λ→λ′→λ′′\lambda \to \lambda' \to \lambda'', and neither the order nor the batching of the data changes the result.

How do you find a conjugate prior? Write the likelihood as a function of θ\theta, drop the factors that do not depend on θ\theta, and take a prior of the same shape. The next blocks do exactly this four times.

Beta–Bernoulli: the coin continues

A coin with nn flips and ss heads has the likelihood

p(X∣θ)=θs(1−θ)n−s.p(X \mid \theta) = \theta^{s} (1 - \theta)^{n - s}.

The binomial model, which records only the number of heads, adds the factor (ns)\binom{n}{s}; it does not depend on θ\theta and cancels in the posterior. As a function of θ\theta the likelihood is a power of θ\theta times a power of 1−θ1 - \theta. The Beta density has the same shape:

Beta⁡(θ∣a,b)=θa−1(1−θ)b−1B(a,b),B(a,b)=Γ(a) Γ(b)Γ(a+b).\operatorname{Beta}(\theta \mid a, b) = \frac{\theta^{a-1} (1 - \theta)^{b-1}}{B(a, b)}, \qquad B(a, b) = \frac{\Gamma(a)\,\Gamma(b)}{\Gamma(a + b)}.

Multiplying, the exponents add up to θa+s−1(1−θ)b+n−s−1\theta^{a + s - 1} (1 - \theta)^{b + n - s - 1}, so

θ∣X∼Beta⁡(a+s,  b+n−s).\theta \mid X \sim \operatorname{Beta}(a + s,\; b + n - s).

Heads go to aa, tails go to bb. That is why aa and bb are read as pseudo-counts: the prior behaves as if we had already seen about aa heads and bb tails. The data enter only through ss and nn.

The moments of the Beta, needed all the time:

Eθ=aa+b,mode⁡=a−1a+b−2    (a,b>1),Var⁡θ=ab(a+b)2(a+b+1).\mathbb E\theta = \frac{a}{a + b}, \qquad \operatorname{mode} = \frac{a - 1}{a + b - 2} \;\; (a, b > 1), \qquad \operatorname{Var}\theta = \frac{ab}{(a + b)^2 (a + b + 1)}.

Back to our coin at Beta⁡(4,1)\operatorname{Beta}(4, 1). Six more flips give 22 heads and 44 tails, and the coin moves to Beta⁡(6,5)\operatorname{Beta}(6, 5). Over all nine flips there were 55 heads, so:

  • the MAP estimate is the mode, 5/9≈0.5565/9 \approx 0.556; with a uniform prior it coincides with the MLE 5/95/9;
  • the posterior mean is 6/11≈0.5456/11 \approx 0.545, slightly pulled towards the prior mean 1/21/2;
  • the probability that the next flip is heads is ∫θ p(θ∣X) dθ=E[θ∣X]=6/11\int \theta\, p(\theta \mid X)\, d\theta = \mathbb E[\theta \mid X] = 6/11.

The posterior mean always lies between the prior mean a/(a+b)a/(a + b) and the observed frequency s/ns/n, and the more flips there are, the closer it gets to the frequency.

Gamma–Poisson: counting events

Now counts: the number of bug reports per day, of calls per hour. A count x∈{0,1,2,…}x \in \{0, 1, 2, \ldots\} is modelled as Poisson⁡(λ)\operatorname{Poisson}(\lambda) with p(x∣λ)=λxe−λ/x!p(x \mid \lambda) = \lambda^x e^{-\lambda} / x!. For nn intervals with total count s=∑ixis = \sum_i x_i the likelihood as a function of λ\lambda is

p(X∣λ)∝λse−nλ.p(X \mid \lambda) \propto \lambda^{s} e^{-n\lambda}.

A power of λ\lambda times an exponential of −λ-\lambda: this is the shape of the Gamma distribution. Throughout the course it is written in shape–rate form,

Gamma⁡(λ∣a,b)=baΓ(a) λa−1e−bλ,Eλ=ab,Var⁡λ=ab2,\operatorname{Gamma}(\lambda \mid a, b) = \frac{b^{a}}{\Gamma(a)}\, \lambda^{a-1} e^{-b\lambda}, \qquad \mathbb E\lambda = \frac{a}{b}, \qquad \operatorname{Var}\lambda = \frac{a}{b^2},

with shape a>0a > 0 and rate b>0b > 0. Multiplying adds the powers and the coefficients in the exponent:

λ∣X∼Gamma⁡(a+s,  b+n).\lambda \mid X \sim \operatorname{Gamma}(a + s,\; b + n).

The pseudo-count reading carries over: the prior is worth about aa events seen over bb intervals.

Example. A team logs bug reports per day. The prior Gamma⁡(6,2)\operatorname{Gamma}(6, 2) says "about 66 bugs over 22 days", mean 33. The next five days bring 4,2,5,3,64, 2, 5, 3, 6 reports, so s=20s = 20 and n=5n = 5. The posterior is Gamma⁡(26,7)\operatorname{Gamma}(26, 7) with mean 26/7≈3.7126/7 \approx 3.71, between the prior mean 33 and the sample mean 44.

The predictive for tomorrow's count is no longer Poisson but negative binomial: it is wider, because λ\lambda itself is uncertain. The Gamma is a natural candidate wherever the likelihood in a positive parameter is a power times an exponential, and the Poisson is not the only such case.

The Normal mean: precisions add

Measurements xi∣μ∼N(μ,σ2)x_i \mid \mu \sim \mathcal N(\mu, \sigma^2) with a known noise variance σ2\sigma^2 and an unknown mean μ\mu. The prior is μ∼N(m0,s02)\mu \sim \mathcal N(m_0, s_0^2). The log of the posterior, up to a constant, is

log⁡p(μ∣X)=−12[1σ2∑i=1n(xi−μ)2+1s02(μ−m0)2]+const.\log p(\mu \mid X) = -\frac12 \left[ \frac{1}{\sigma^2} \sum_{i=1}^{n} (x_i - \mu)^2 + \frac{1}{s_0^2} (\mu - m_0)^2 \right] + \text{const}.

It is a quadratic in μ\mu, so the posterior is Gaussian, μ∣X∼N(mn,sn2)\mu \mid X \sim \mathcal N(m_n, s_n^2). Collect the coefficient of μ2\mu^2 and of μ\mu and complete the square:

1sn2=1s02+nσ2,mn=sn2(m0s02+1σ2∑i=1nxi).\frac{1}{s_n^2} = \frac{1}{s_0^2} + \frac{n}{\sigma^2}, \qquad m_n = s_n^2 \left( \frac{m_0}{s_0^2} + \frac{1}{\sigma^2} \sum_{i=1}^{n} x_i \right).

Read it in terms of precision, the inverse variance. The precisions of the prior and of the data add up. The posterior mean is an average of the prior mean and the data, weighted by their precisions.

Example. Prior N(0,1)\mathcal N(0, 1), noise σ2=4\sigma^2 = 4, four measurements 2.5,0.5,1.0,2.02.5, 0.5, 1.0, 2.0 with xˉ=1.5\bar x = 1.5. The precision is 1+4/4=21 + 4/4 = 2, so sn2=0.5s_n^2 = 0.5, and mn=0.5⋅(0+6/4)=0.75m_n = 0.5 \cdot (0 + 6/4) = 0.75.

What about the next measurement? Write it as x∗=μ+εx^* = \mu + \varepsilon, where μ\mu follows the posterior and ε∼N(0,σ2)\varepsilon \sim \mathcal N(0, \sigma^2) is fresh noise, independent of μ\mu. A sum of independent Gaussians is Gaussian, with means and variances adding:

x∗∣X∼N(mn,  sn2+σ2)=N(0.75,  4.5).x^* \mid X \sim \mathcal N(m_n,\; s_n^2 + \sigma^2) = \mathcal N(0.75,\; 4.5).

The first term is uncertainty about the parameter, the second is noise. The topic Bayesian linear regression repeats this whole block with a weight vector instead of a single μ\mu.

Unknown precision and the Normal–Gamma

Now the opposite case: the mean μ0\mu_0 is known and the spread is not. Work with the precision τ=1/σ2\tau = 1/\sigma^2, so xi∣τ∼N(μ0,τ−1)x_i \mid \tau \sim \mathcal N(\mu_0, \tau^{-1}). Each density carries τ\sqrt{\tau} in front, so the likelihood as a function of τ\tau is

p(X∣τ)∝τn/2exp⁡ ⁣(−τ2∑i(xi−μ0)2).p(X \mid \tau) \propto \tau^{n/2} \exp\!\Big( -\frac{\tau}{2} \sum_{i} (x_i - \mu_0)^2 \Big).

Again a power times an exponential, so the prior is τ∼Gamma⁡(a0,b0)\tau \sim \operatorname{Gamma}(a_0, b_0) and

τ∣X∼Gamma⁡(a0+n2,  b0+12∑i(xi−μ0)2).\tau \mid X \sim \operatorname{Gamma}\Big( a_0 + \frac{n}{2},\; b_0 + \frac12 \sum_i (x_i - \mu_0)^2 \Big).

Example. μ0=1\mu_0 = 1, prior Gamma⁡(1,1)\operatorname{Gamma}(1, 1), data 1.2,0.4,2.1,1.5,0.81.2, 0.4, 2.1, 1.5, 0.8. The squared deviations sum to 1.901.90, the posterior is Gamma⁡(3.5,1.95)\operatorname{Gamma}(3.5, 1.95), and E[τ∣X]≈1.79\mathbb E[\tau \mid X] \approx 1.79. The MLE is n/1.90≈2.63n / 1.90 \approx 2.63; the prior with mean 11 pulls the estimate down. Larger deviations mean a larger rate and a smaller precision.

Both unknown. The likelihood contains τ∑i(xi−μ)2\tau \sum_i (x_i - \mu)^2: a cross term between μ\mu and τ\tau. It does not split into a factor for μ\mu and a factor for τ\tau, so a product of independent Normal and Gamma priors is not conjugate. The conjugate prior is joint, the Normal–Gamma:

μ∣τ∼N(m0,(κ0τ)−1),τ∼Gamma⁡(a0,b0).\mu \mid \tau \sim \mathcal N\big(m_0, (\kappa_0 \tau)^{-1}\big), \qquad \tau \sim \operatorname{Gamma}(a_0, b_0).

The variance of μ\mu depends on τ\tau, and κ0\kappa_0 says how many observations the prior guess m0m_0 is worth. With xˉ=1n∑ixi\bar x = \frac1n \sum_i x_i the updates are

κn=κ0+n,mn=κ0m0+nxˉκn,an=a0+n2,\kappa_n = \kappa_0 + n, \qquad m_n = \frac{\kappa_0 m_0 + n \bar x}{\kappa_n}, \qquad a_n = a_0 + \frac{n}{2}, bn=b0+12∑i(xi−xˉ)2+κ0n2κn(xˉ−m0)2.b_n = b_0 + \frac12 \sum_i (x_i - \bar x)^2 + \frac{\kappa_0 n}{2\kappa_n} (\bar x - m_0)^2.

The rate collects the scatter of the data around their own mean plus the disagreement between that mean and the prior guess. On the same five points with m0=0m_0 = 0 and κ0=a0=b0=1\kappa_0 = a_0 = b_0 = 1: xˉ=1.2\bar x = 1.2, κn=6\kappa_n = 6, mn=1.0m_n = 1.0, an=3.5a_n = 3.5, bn=1+0.85+0.6=2.45b_n = 1 + 0.85 + 0.6 = 2.45. Integrating out τ\tau, the marginal posterior of μ\mu is a Student t-distribution with 2an=72a_n = 7 degrees of freedom: heavier tails than a Gaussian, because the noise level itself is uncertain.

The exponential family

Four conjugate pairs, four lucky coincidences? No. All four likelihoods belong to one family. A distribution is in the exponential family if its density can be written as

p(x∣η)=h(x)exp⁡(η⊤u(x)−A(η)),A(η)=log⁡∫h(x) eη⊤u(x) dx.p(x \mid \eta) = h(x) \exp\big( \eta^\top u(x) - A(\eta) \big), \qquad A(\eta) = \log \int h(x)\, e^{\eta^\top u(x)}\, dx.

Here η\eta is the natural parameter, u(x)u(x) the sufficient statistics, h(x)h(x) the base measure, and A(η)A(\eta) the log-partition function, the log of the normalizing constant. The natural parameter is often not the usual one:

Distribution η\eta u(x)u(x) A(η)A(\eta) h(x)h(x)
Bernoulli⁡(θ)\operatorname{Bernoulli}(\theta) log⁡θ1−θ\log\frac{\theta}{1 - \theta} xx log⁡(1+eη)\log(1 + e^\eta) 11
Poisson⁡(λ)\operatorname{Poisson}(\lambda) log⁡λ\log\lambda xx eηe^\eta 1/x!1/x!
N(μ,σ2)\mathcal N(\mu, \sigma^2) (μσ2,−12σ2)\big(\frac{\mu}{\sigma^2}, -\frac{1}{2\sigma^2}\big) (x,x2)(x, x^2) μ22σ2+log⁡σ\frac{\mu^2}{2\sigma^2} + \log\sigma 12π\frac{1}{\sqrt{2\pi}}

Two things are required: the support of xx must not depend on the parameter, and log⁡p\log p must be linear in the statistics, with all the dependence on the parameter collected in η\eta and A(η)A(\eta).

Sufficient statistics of fixed size. For an independent sample

p(X∣η)=[∏ih(xi)]exp⁡(η⊤∑iu(xi)−nA(η)).p(X \mid \eta) = \Big[ \prod_i h(x_i) \Big] \exp\Big( \eta^\top \sum_i u(x_i) - nA(\eta) \Big).

The data reach the parameter only through nn and U(X)=∑iu(xi)U(X) = \sum_i u(x_i): the number of heads for the coin, ∑ixi\sum_i x_i and ∑ixi2\sum_i x_i^2 for the Gaussian. By the Fisher–Neyman factorization criterion, U(X)U(X) is sufficient, and its size does not grow with nn.

Derivatives of AA give moments. Differentiate eA(η)=∫h(x)eη⊤u(x)dxe^{A(\eta)} = \int h(x) e^{\eta^\top u(x)} dx under the integral:

∇A(η)=Eη[u(x)],∇2A(η)=Cov⁡η[u(x)]⪰0.\nabla A(\eta) = \mathbb E_\eta[u(x)], \qquad \nabla^2 A(\eta) = \operatorname{Cov}_\eta[u(x)] \succeq 0.

For the Poisson, A=eηA = e^\eta, and both derivatives equal eη=λe^\eta = \lambda: the mean and the variance of a Poisson are both λ\lambda.

Concavity. The log-likelihood ℓ(η)=const+η⊤U(X)−nA(η)\ell(\eta) = \text{const} + \eta^\top U(X) - nA(\eta) has Hessian −nCov⁡η[u]⪯0-n\operatorname{Cov}_\eta[u] \preceq 0, so it is concave in η\eta. At a maximum Eη[u(x)]=1nU(X)\mathbb E_\eta[u(x)] = \frac1n U(X): the model's expected statistics match the sample ones (moment matching). Three caveats. Concavity holds in the natural parameter, not in an arbitrary one such as σ2\sigma^2. Strict concavity needs statistics without affine dependence. And concavity does not promise a finite maximum: after 1010 heads in 1010 flips, η^ML=+∞\hat\eta_{\text{ML}} = +\infty.

The general conjugate prior

As a function of η\eta, the likelihood of a sample is exp⁡(η⊤U(X)−nA(η))\exp\big(\eta^\top U(X) - nA(\eta)\big). Take a prior of the same form, with hyperparameters χ\chi and ν\nu:

p(η∣χ,ν)∝exp⁡(η⊤χ−νA(η)).p(\eta \mid \chi, \nu) \propto \exp\big( \eta^\top \chi - \nu A(\eta) \big).

Multiplying adds the exponents:

χ′=χ+∑iu(xi),ν′=ν+n.\chi' = \chi + \sum_i u(x_i), \qquad \nu' = \nu + n.

This is the general conjugate prior of the exponential family. The reading is the same as before: the prior acts like ν\nu imaginary observations whose statistics add up to χ\chi, and every update simply adds the real statistics to the imaginary ones. The hyperparameters must keep the prior normalizable; that is the only constraint.

The Beta as an instance. For the Bernoulli eη=θ/(1−θ)e^\eta = \theta/(1 - \theta) and 1+eη=1/(1−θ)1 + e^\eta = 1/(1 - \theta), so

eηχ−νlog⁡(1+eη)=θχ(1−θ)ν−χ.e^{\eta\chi - \nu \log(1 + e^\eta)} = \theta^{\chi} (1 - \theta)^{\nu - \chi}.

This is a density over η\eta. To get a density over θ\theta, multiply by the Jacobian ∣dη/dθ∣=1θ(1−θ)\lvert d\eta/d\theta \rvert = \frac{1}{\theta(1 - \theta)}:

p(θ)∝θχ−1(1−θ)ν−χ−1=Beta⁡(χ,  ν−χ).p(\theta) \propto \theta^{\chi - 1} (1 - \theta)^{\nu - \chi - 1} = \operatorname{Beta}(\chi,\; \nu - \chi).

So a=χa = \chi is the number of prior heads and b=ν−χb = \nu - \chi the number of prior tails, and the update χ+s\chi + s, ν+n\nu + n is exactly Beta⁡(a+s,b+n−s)\operatorname{Beta}(a + s, b + n - s). The "−1-1" in the Beta exponents is the Jacobian. Our coin has walked (χ,ν)=(1,2)→(4,5)→(6,11)(\chi, \nu) = (1, 2) \to (4, 5) \to (6, 11).

A side note. Conjugate priors exist outside the family too: the uniform on [0,θ][0, \theta] has the Pareto as a conjugate prior. But among models with a fixed support, only the exponential family has sufficient statistics of fixed size, under mild regularity conditions (the Pitman–Koopman–Darmois theorem), so this is where conjugacy lives systematically.

Eight standard distributions, and what comes next

The eight distributions that every topic of the course takes for granted. Outside the listed support the density or probability is zero; for continuous ones p(x)p(x) is a density, not the probability of a point.

Distribution Support p(x)p(x) Ex\mathbb E x Var⁡x\operatorname{Var} x
Bernoulli⁡(θ)\operatorname{Bernoulli}(\theta) {0,1}\{0, 1\} θx(1−θ)1−x\theta^x (1 - \theta)^{1 - x} θ\theta θ(1−θ)\theta(1 - \theta)
Bin⁡(m,θ)\operatorname{Bin}(m, \theta) 0,…,m0, \ldots, m (mx)θx(1−θ)m−x\binom{m}{x} \theta^x (1 - \theta)^{m - x} mθm\theta mθ(1−θ)m\theta(1 - \theta)
N(μ,σ2)\mathcal N(\mu, \sigma^2) R\mathbb R 12πσ2e−(x−μ)2/(2σ2)\frac{1}{\sqrt{2\pi\sigma^2}} e^{-(x - \mu)^2 / (2\sigma^2)} μ\mu σ2\sigma^2
U⁡(l,r)\operatorname{U}(l, r) [l,r][l, r] 1r−l\frac{1}{r - l} l+r2\frac{l + r}{2} (r−l)212\frac{(r - l)^2}{12}
Beta⁡(a,b)\operatorname{Beta}(a, b) (0,1)(0, 1) xa−1(1−x)b−1B(a,b)\frac{x^{a-1} (1 - x)^{b-1}}{B(a, b)} aa+b\frac{a}{a + b} ab(a+b)2(a+b+1)\frac{ab}{(a + b)^2 (a + b + 1)}
Exp⁡(λ)\operatorname{Exp}(\lambda) x≥0x \ge 0 λe−λx\lambda e^{-\lambda x} 1λ\frac{1}{\lambda} 1λ2\frac{1}{\lambda^2}
Poisson⁡(λ)\operatorname{Poisson}(\lambda) 0,1,2,…0, 1, 2, \ldots λxe−λx!\frac{\lambda^x e^{-\lambda}}{x!} λ\lambda λ\lambda
Gamma⁡(a,b)\operatorname{Gamma}(a, b) x>0x > 0 baΓ(a)xa−1e−bx\frac{b^a}{\Gamma(a)} x^{a-1} e^{-bx} ab\frac{a}{b} ab2\frac{a}{b^2}

They are linked: Bernoulli⁡(θ)=Bin⁡(1,θ)\operatorname{Bernoulli}(\theta) = \operatorname{Bin}(1, \theta), Beta⁡(1,1)=U⁡(0,1)\operatorname{Beta}(1, 1) = \operatorname{U}(0, 1), Gamma⁡(1,b)=Exp⁡(b)\operatorname{Gamma}(1, b) = \operatorname{Exp}(b). In the Gamma, bb is a rate, not a scale; libraries such as numpy and scipy take the scale 1/b1/b.

And the map of conjugate pairs from this topic:

Likelihood Prior Posterior
Bernoulli / binomial, ss successes in nn Beta⁡(a,b)\operatorname{Beta}(a, b) Beta⁡(a+s,b+n−s)\operatorname{Beta}(a + s, b + n - s)
Poisson, total count ss over nn intervals Gamma⁡(a,b)\operatorname{Gamma}(a, b) Gamma⁡(a+s,b+n)\operatorname{Gamma}(a + s, b + n)
Exponential, total time TT of nn waits Gamma⁡(a,b)\operatorname{Gamma}(a, b) Gamma⁡(a+n,b+T)\operatorname{Gamma}(a + n, b + T)
Normal, known σ2\sigma^2 N(m0,s02)\mathcal N(m_0, s_0^2) N(mn,sn2)\mathcal N(m_n, s_n^2), precisions add
Normal, known mean μ0\mu_0 Gamma⁡(a0,b0)\operatorname{Gamma}(a_0, b_0) on τ\tau Gamma⁡(a0+n2,b0+12∑i(xi−μ0)2)\operatorname{Gamma}\big(a_0 + \frac n2, b_0 + \frac12 \sum_i (x_i - \mu_0)^2\big)
Normal, both unknown Normal–Gamma κn,mn,an,bn\kappa_n, m_n, a_n, b_n above

One more gift of conjugacy. The evidence is a ratio of normalizers: for a sequence of flips p(X)=B(a+s,b+n−s)/B(a,b)p(X) = B(a + s, b + n - s) / B(a, b). Our nine flips under the uniform prior give p(X)=B(6,5)/B(1,1)=1/1260p(X) = B(6, 5) / B(1, 1) = 1/1260. A rival model, "the coin is exactly fair", has no free parameter and gives p(X)=2−9=1/512p(X) = 2^{-9} = 1/512, two and a half times more. Both models fit five heads in nine flips; the simpler one predicted them better. Which one should we believe, and why does simplicity win here? That is the topic Bayesian model selection.

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Full notes

Answers are saved on the server and tied to this browser until you sign in.