Start with reviewing concepts such as conditional probability and conditional expectation. You can think of conditioning as of subsetting. The conditional mean for age given that the person is a female would mean just calculating the average age of all the females. In the case of "conditional mean of the price data given yesterday's price," we are talking about conditional distribution, i.e. a function that maps any possible value of yesterday's price to the expected value of the next day's price. In SQL pseudocode this basically means
WITH price_data AS (
SELECT
p.price AS prev_day_price,
n.price AS next_day_price
FROM prices AS p
LEFT JOIN prices AS n
ON p.date = (n.date - 1 DAY)
)
SELECT
prev_day_price,
AVG(next_day_price) AS conditional_mean
FROM price_data
GROUP BY prev_day_price
The same would apply to conditional quantiles or other statistics. In practice though, it may be hard to calculate directly from the data because you would need to observe enough next_day_price
data for each of the levels of prev_day_price
, it also would be problematic if you are conditioning on a continuous variable that has an infinite number of possible levels. To solve this, we usually use statistical models: linear regression to calculate the conditional mean and quantile regression to calculate conditional quantiles.
If those contents are still unclear, I'd recommend that you consult with an introductory probability and statistics handbook or a course because it might be hard to understand without understanding many related concepts.