RUVIDEO
Поделитесь видео 🙏

R Tutorial : Aggregating log-returns смотреть онлайн

Want to learn more? Take the full course at https://learn.datacamp.com/courses/quantitative-risk-management-in-r at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.

---

I remarked before that it is easy to aggregate shorter interval log-returns like daily returns to obtain longer-interval returns like weekly or monthly returns. Effectively you just add them up!

Why would you want to do this? Well, by aggregating returns you can study the risks over longer time horizons, such as a month, a quarter or a year.

There is some simple mathematics behind the aggregation of log-returns. Let's assume that the series (X_t) are daily log-returns calculated from daily risk-factor values (Z_t).

Let's assume further that (Z_t) is a price series for some asset that is traded on weekdays.

To get the log-return for a whole trading week starting on day t (effectively the previous Friday evening price before markets open on the Monday morning) and ending on day t+5 (Friday evening again) you would calculate the difference log(Z_{t+5}) - log(Z_t).

It can be shown that this is just the sum of the log-returns for each of the trading days.

And a similar calculation works for any aggregation period.

To do this in R you can use a set of functions in the xts package with names like apply.weekly and apply.monthly.

If the object sp500x is an xts object contains daily log-returns you obtain weekly returns by applying the sum function within the apply.weekly function. Note how the returns now have date stamps that are seven days apart.

Similarly to get monthly returns you apply the sum function within the apply.monthly function. Now the date stamps are the last days of each calendar month.

Note that if you have a multivariate time series containing, for example, multiple stock prices you have to apply the function colSums() instead of sum(). Look out for an example of that at the end of the next exercise.

So now it is time to practise aggregating log-return series.

#DataCamp #RTutorial #QuantitativeRiskManagementinR

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «R Tutorial : Aggregating log-returns» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.