# How to test for a equality of the mean of two bounded random variables

Good morning all together, as a statistics rookie, I'm facing the task how to test for a difference in the mean of two random variables that are bound between 0 and 1. Both their means are positive and in one case (potentially) autocorrelated as those random variables are time series.

In detail, these random variables are generated in two settings, where in setting 1 both variables are the result of a calibration and consequently time series of observations.

In the another setting, these variables are the result of a monte carlo simulation, where autocorrelation can be excluded by construction. In both settings, these random variables are possibly correlated (but not correlated by construction but by mere chance).

My question is: Which test can i use to check whether the mean of one random variable is larger than the other mean for either setting? In addition, how can i test this if only one random variable is autocorrelated and the other one is not?

Thank you very much for your suggestions, Thomas

The autocorrelation makes this difficult.

For the sample with no autocorrelation, the Central Limit Theorem applies, so the sample mean is approximately normally distributed. Comparing the means of two such samples is a standard problem.

But for the sample with potential autocorrelation, the mean could drift over time. The question you ask is only meaningful if the duration of the sample is much longer than the duration of the autocorrelation. So first, you need to model the autocorrelation, so you can satisfy yourself on this issue.

• Thank you for your answer. As mentioned in my question, I'm a bit puzzled. For the CLT to hold i need a very large number of observations. As far as i understand, the first part of your answer also holds if the autocorrelation is also stochastic and time-varying given the sample is very large?
– T123
May 25, 2023 at 8:23
• I was thinking about a Wilcoxon-Test as my two variables could be dependent and as no autocorrelation is mentioned?
– T123
May 25, 2023 at 9:12
• @T123 "For the CLT to hold i need a very large number of observations." In most situations the distribution of means of 20 observations is very close to a normal (unless you have extreme outliers - or autocorrelation). May 25, 2023 at 10:51
• @T123 Wilcoxon doesn't help with dependence. May 25, 2023 at 10:52
• @T123 The answer is good. The problem seems nonstandard, there is probably not a simple standard solution to it. I'd look at time series models with covariates and add a dummy covariate to distinguish your two groups. You can then test whether this has an impact. Also here things based on normal distributions may well apply approximately. May 25, 2023 at 11:07