Publications by insightr
Online portfolio allocation with a very simple algorithm
By Yuri Resende Today we will use an online convex optimization technique to build a very simple algorithm for portfolio allocation. Of course this is just an illustrative post and we are going to make some simplifying assumptions. The objective is to point out an interesting direction to approach the problem of portfolio allocation. The algori...
5020 sym R (3624 sym/6 pcs) 75 img 3 tbl
Cross-Fitting Double Machine Learning estimator
By Gabriel Vasconcelos Motivation In a late post I talked about inference after model selection showing that a simple double selection procedure is enough to solve the problem. In this post I’m going to talk about a generalization of the double selection for any Machine Learning (ML) method described by Chernozhukov et al. (2016). Suppose you ...
3424 sym R (2344 sym/2 pcs) 92 img
Dealing with S3 methods in R with a simple example
By Gabriel Vasconcelos S3 objects R has three object systems: S3, S4 and RC. S3 is by far the easiest to work with and it can make you codes much understandable and organized, especially if you are working on a package. The idea is very simple. First we must define a class to some object in R and then we define methods (functions) for this class ...
2987 sym R (1465 sym/4 pcs) 6 img
ArCo Package v 0.2 is on
The ArCo package 0.2 is now available on CRAN. The functions are now more user friendly. The new features are: Default function for estimation if the user does not inform the functions fn and p.fn. The default model is Ordinary Least Squares. The user can now add extra arguments to the fn function in the call. The data will be automatically coer...
764 sym 4 img
Counterfactual estimation on nonstationary data, be careful!!!
By Gabriel Vasconcelos In a recent paper that can be downloaded here, Carvalho, Masini and Medeiros show that estimating counterfactuals in a non-stationary framework (when I say non-stationary it means integrated) is a tricky task. It is intuitive that the models will not work properly in the absence of cointegration (spurious case), but what th...
4784 sym R (2940 sym/6 pcs) 42 img
The package hdm for double selection inference with a simple example
By Gabriel Vasconcelos In a late post I discussed the Double Selection (DS), a procedure for inference after selecting controls. I showed an example of the consequences of ignoring the variable selection step discussed in an article by Belloni, Chernozhukov and Hansen. Some of the authors of the mentioned article created the hdm package, which i...
3603 sym R (1113 sym/1 pcs) 24 img
Treating your data: The old school vs tidyverse modern tools
By Gabriel Vasconcelos When I first started using R there was no such thing as the tidyverse. Although some of the tidyverse packages were available independently, I learned to treat my data mostly using brute force combining pieces of information I had from several sources. It is very interesting to compare this old school programming with the t...
3539 sym R (1746 sym/8 pcs) 4 img
Pricing Optimization: How to find the price that maximizes your profit
By Yuri Fonseca Basic idea In this post we will discuss briefly about pricing optimization. The main idea behind this problem is the following question: As manager of a company/store, how much should I charge in order to maximize my revenue or profit? Obviously, the answer isn’t as high as possible. If you charge one hundred dollars for a cand...
4204 sym R (3273 sym/6 pcs) 58 img 1 tbl
Combining and comparing models using Model Confidence Set
By Gabriel Vasconcelos In many cases, especially if you are dealing with forecasting models, it is natural to use a large set of models to forecast the same variable and then select the best model using some error measure. For example, you can break the sample into a training sample (in-sample) and a test sample (out-of-sample), estimate all mod...
4960 sym R (3927 sym/6 pcs) 42 img
R Course in Rio de Janeiro
R Course in Rio de Janeiro We are preparing an R for Data-Science course (direct link here) in partnership with the IBPAD (Brazilian Institute of Research and Data Analysis). It is a great course for those who want to have a solid start in R. No prior knowledge in statistics, calculus or programming is required. The course starts in October 16th...
1423 sym 4 img