I'm an applied social scientist with an interest in time series analysis. I have a question about the behavior of a 'geometric series' of a non-constant, so to speak.
If we had a geometric series like
\begin{align} & \rho^{0} + \rho^{1} + \rho^{2} + \rho^{3} + \ldots \\ = & \sum_{j=0}^{\infty}\rho^{j} \end{align}
and if $|\rho| < 1$, then this should converge to
\begin{align} & (1 - \rho)^{-1}. \end{align}
Here is some R code to verify it:
set.seed(123)
t <- 100000
rho <- 0.2
total = 0
for(i in 1:t){
total = total + rho^(i - 1)
}
total
[1] 1.25
(1 - rho)^-1
[1] 1.25
What if $\rho$ was not a constant but rather a random variable? Something like
\begin{align} \rho_{1}^{0} + \rho_{2}^{1} + \rho_{3}^{2} + \rho_{4}^{3} + \ldots \end{align}
where $\rho_{i}$ is the $i$th draw or realization. Say it was normally distributed with some mean, $\bar{\rho}$ and standard deviation, $\sigma_{\rho}$.
Are there any helpful properties to perhaps simplify such a 'geometric series' of a random variable?
My naive initial thought was that because the sum of random variable is equal to the mean times the number of observations, e.g., $\sum_{i=1}^{n}x_{i} = n\bar{x}$, the sum of the 'geometric series' of this random variable would be $(1 - \bar{\rho})^{-1}$, but this does not seem to be the case:
rhot <- rnorm(t, rho, 0.1)
total = 0
for(i in 1:length(rhot)) {
total = total + rhot[i]^(i - 1)
}
total
[1] 1.32187
This value itself is a random variable, so I constructed a simulation to get a feel for the distribution of the variable in repeated samples of size t
geom_series <- function(t, meanrho, sdrho) {
rhot <- rnorm(t, meanrho, sdrho)
total = 0
for(i in 1:length(rhot)) {
total = total + rhot[i]^(i - 1)
}
return(total)
}
sim <- replicate(n = 10000,
expr = geom_series(t = t, meanrho = 0.2, sdrho = 0.1))
mean(sim)
[1] 1.270227
which is close but not identical to $(1 - \bar{\rho})^{-1} = (1 - 0.2)^{-1} = 1.25$. Also, this whole thing is very unstable: I think if any random draw of $\rho_{i}$ is greater than |1|, the whole thing explodes to infinity, or at least that's what R is returning. This means this can't really be calculated for $\bar{\rho}$ close to |1|, or if the distribution of $\rho_{i}$ has a large standard deviation.
I would really appreciate if someone could help me understand what I'm observing here and maybe point me in the direction of some resources (optimally resources that an applied social scientist might be able to get!). Thanks!