# conditional quantile and conditional expectation

I was reading some papers and I found some parts are tricky to understand.

Assume I have price data , what does it mean to calculate the conditional mean of the price data given yesterday price ? does that mean the price is known? I know to calculate the expectation of the price I sum all the prices then divide them by the number of observation, is this is the same ?

I also came up by the terminology of conditional quantile of the price data , where the simplest way to estimate it rely on the Maximum Likelihood Estimation (MLE). I found it interesting but I could not understand how to estimate the conditional quantile by Maximum Likelihood Estimation. can anyone help me with some explanations and examples to understand. I read several papers but I could not understand.

Thank you.

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.