Taylor
  • Member for 10 years
  • Last seen this week
R: return date from element in time series
Accepted answer
4 votes

time takes "a univariate or multivariate time-series, or a vector or matrix." How about time(airline.ts)[6]?

View answer
Can someone explain Gibbs sampling in very simple words?
4 votes

From wikipedia: "The goal of Gibbs Sampling here is to approximate the distribution of $P(\mathbf{Z}|\mathbf{W};\alpha,\beta)$" Notation can be found on the wiki site or from the original paper here. ...

View answer
Understanding the spectral decomposition of a Markov matrix?
4 votes

This is all from here: http://cims.nyu.edu/~holmes/teaching/asa15/Lecture2.pdf TLDR: your still using the spectral decomposition theorem; you just have to find the right symmetric matrix. Detailed ...

View answer
Can the horseshoe prior be expressed analytically?
Accepted answer
3 votes

The normal conditional density's normalizing constant is not free of lambda, so Wolfram is integrating the wrong thing. $$ (2\pi)^{-1}\int_0^\infty \underbrace{(2\pi\tau^2\lambda^2)^{-1/2}}_{\text{...

View answer
What is this projection matrix doing?
Accepted answer
3 votes

Multiplying $X$ by $W$ gives you transformed data. Multiplying $X$ by $P$ gives you $X$ again ($P$ is the identity matrix because the eigenvectors are orthogonal). Observe that $$ \text{Var}\left[W^...

View answer
How can I derive the variance of the half-normal distribution?
Accepted answer
3 votes

Hint: if $X \sim \text{HalfNormal}(\sigma^2)$ and $Y \sim \text{Normal}(0,\sigma^2)$, then for any symmetric and integrable $f$ $$ E[f(X)] = E[f(|Y|)] = E[f(Y)|Y \ge 0] = 2 E[f(Y) 1(Y \ge 0)]. $$ I ...

View answer
Particle filter: Evaluating Optimal importance density
Accepted answer
3 votes

You're mistaken about a few things (and that's okay!). In this case the optimal proposal density...is [available]. I believe this is only true if $f$, the state transition is Gaussian. It can be ...

View answer
Simplifying modified Bessel function of the first kind
Accepted answer
3 votes

Actually, that formula above is not for the modified Bessel function of the first kind, it is for the (non-modified) Bessel function of the first kind! Furthermore, the Encyclopedia of Mathematics has ...

View answer
Delta Method Confidence Interval: Dividing by $\sqrt{n}$
Accepted answer
3 votes

If $$ \sqrt{n}[g(\hat{\theta}) - g(\theta)] \rightarrow_{d} N(0, \sigma^2[g'(\theta)]^2) $$ (note the typo you made in the variance term) then for a "large" $n$ it is approximately true that $$ \...

View answer
Smallest gap between $n$ Poisson events
3 votes

As I mention here, the interarrival times $T_1, T_2, \ldots$ are distributed as $\text{Exponential}(\lambda)$ random variables. You seem to be interested in $T=\min (T_1,...,T_n)$ somehow, but as @...

View answer
Bayesian inference about means, observing only the sum of two random variables
Accepted answer
3 votes

You are correct that $Z\mid \mu_x,\mu_y,\sigma^2_x,\sigma^2_y \sim \mathcal{N}(\mu_x + \mu_y, \sigma_x^2 + \sigma_y^2)$. First note that this likelihood is not identifiable. This is because $\mu_x,\...

View answer
Geometric distribution with a capped number of trials - finding expectation and prior predictive distribution
Accepted answer
3 votes

Here's a few things that might help. I left the derivation of the prior predictive distribution left for you because it follows some of the same tricks I used towards the end. First, the expectation ...

View answer
Forecasting in a state-space model from a Bayesian perspective
Accepted answer
3 votes

Yes, if you're drawing one $x_{T+1}$ for every sample joint posterior sample $x_{1:T},\theta$. To be more clear, you are correct if you do the following steps for $i=1,2,\ldots$: -1. Draw $\theta[i]...

View answer
Integrate out (covariance) matrix in Normal-Wishart distribution
Accepted answer
3 votes

First, notice that, if you use some properties of the trace operator, \begin{align*} p(\mu, \Sigma) &\propto \lvert \Sigma\rvert^{-((\nu_0+d)/2+1)}\exp\Big(-\frac{1}{2}\text{tr}(\Lambda_0\Sigma^{-...

View answer
Definition of softmax function
3 votes

Yes, you are correct that there is a lack of identifiability unless one of the coefficent vectors is fixed. There are some reasons that don't mention this. I can't speak to why they omit this detail, ...

View answer
Probability density function with an unknown constant
Accepted answer
3 votes

Note, I am treating this as if it has been tagged with a self-study tag. Regarding (a), yes, the density must integrate to $1$, and it must be nonnegative everywhere. Integrate over that unit square ...

View answer
Why is spectral density only defined for stationary processes?
Accepted answer
3 votes

To quote Brockwell and Davis: "[t]he summability of $|\gamma(\cdot)|$ implies that the series converges absolutely..." When you look at the definition of the spectral density $$ f(\lambda) = \frac{1}{...

View answer
How to find and draw the Bayes decision boundary in LDA (2 classes)?
Accepted answer
3 votes

Main idea: Let $y \in \{1,2\}$ be the output, and $x \in \mathbb{R}^2$ be the input. Using Bayes' theorem: $p(y=1 \mid x) = \frac{p(x \mid y=1)\pi_1}{p(x)}$ $p(y=2 \mid x) = \frac{p(x \mid y=2)\pi_2}...

View answer
Bayesian regression - prior dist for variables
Accepted answer
3 votes

In a multiple Bayesian linear regression model, do all variables (dependent and predictors) get prior distributions? All parameters get a prior. Random variables/data might get a prior if you're ...

View answer
Are particle filters necessarily linked to state-space models?
3 votes

All particle filters are for state state space models, but not all state space models need a particle filter. Below is a quick explanation. You need a few probability distributions to define a state ...

View answer
Propagation of errors for a sum of fractions of random variables
Accepted answer
3 votes

Yes, the variance of the sum is the sum of the variances, in this case. By the law of the unconscious statistician, for $i\neq j$: \begin{align*} E\left[\frac{X_i}{Y_i}\frac{X_j}{Y_j} \right] &= \...

View answer
Likelihood function when only $\max_{1\le i\le N}X_i$ is observed and $N$ is parameter
Accepted answer
3 votes

Hint: the likelihood for $T$ is $$ f_{T}(t ; N) = N(1-e^{-t})^{N-1}e^{-t}. $$ To verify this, first find the cdf of $T$, and then differentiate. \begin{align*} F_T(t) &= P(T \le t)\\ &= [F_{...

View answer
Posterior of $\text{Normal}(\theta,1)$ with a Cauchy prior distribution
3 votes

What do you mean by "find?" I can tell you $\pi(\theta \mid x)$ is proportional to $$ f(x \mid \theta) \pi(\theta) \propto \exp\left[-\frac{(\theta - x)^2}{2} - \log(1 + \theta^2) \right], $$ but I ...

View answer
Understanding the Proof for why Jeffreys' prior is invariant
3 votes

Regarding your edit, that's not right. You also need the product rule: \begin{align*} \frac{d^2\log p(y | \phi)}{d\phi^2} &= \frac{d}{d\phi} \left( \frac{d \log p(y|\theta(\phi))}{d \theta} \...

View answer
Plotting the Likelihood of a Bernoulli Distribution
Accepted answer
3 votes

The formula in likelihood is correct, but the bigger your data set gets, the more problems you're going to have with numerical underflow. That's why so many of the points in your graph are being ...

View answer
How to evaluate $\int_0^\infty m^{x+1}e^{-2m}dm$ as $\Gamma(x+2)\frac{1}{2}^{x+2}$?
Accepted answer
3 votes

Let $z = 2m$, then $\frac{\text{d}z}{\text{d}m} = 2$ and your integral equals $$ \int_0^\infty m^{x+1}e^{-2m}\text{d}m = 2^{-x-2}\int_0^{\infty} z^{x+1} e^{-z}\text{d}z = 2^{-x-2} \Gamma(x+2). $$ ...

View answer
Maximum likelihood estimator for $\theta$
3 votes

First, you have the wrong log-likelihood. You might want to go back and check that part. Second, this likelihood, when thought of as a function in $\theta$, is only nonzero whenever $\theta$ is less ...

View answer
Derivation of the ARMA model as acombination of the AR and MA models
3 votes

No, there is no way to explain this discrepancy because it does not make sense to sum together an AR and MA model in the way you have, because $X_t$ cannot be both an AR model and an MA model at the ...

View answer
A sufficient condition $p(\theta)$ to be the stationary distribution is the reversibility
Accepted answer
3 votes

A discrete Markov chain $\theta_1, \theta_2, \ldots$ with transition pmf $k(\theta_{t+1} \mid \theta_t)$ is reversible if joint pmfs for two consecutive time points are "symmetric", or in other words $...

View answer
Is the posterior of a random variable's mean necessarily the mean of that random variable's posterior?
3 votes

Is it necessarily true that $\theta_2 | Y$ is the mean of $\theta_1 |Y$? No, they just have the same "centers." The mean of $\theta_1 | Y$ is $$ E[\theta_1 \mid Y] = E[ E(\theta_1 \mid \theta_2) \mid ...

View answer
1 2 3
4
5
17