Skip to content

How to fit a linear model to data by minimizing the mean absolute percent error?

3 messages · Bert Gunter, Andre Cesta

#
Take the logs of both side and minimize the absolute error on the log
scale, then transform your results back. The quantreg package does L1
regression.

If you want to know **why**, this works, consult a local statistician
or post to a statistical list like stats.stackexchange.com.  This is
not an R question.

--- Bert
On Mon, Jan 14, 2013 at 4:22 AM, Andre Cesta <aacesta at yahoo.com> wrote:

  
    
#
Hi Bert,

Thanks for your reply.

Your recommendation seems to minimize the error transformed with log, but not the percent error, that is, the model error divided by the observed value (for each observation).

I need to minimize the percent error.

With log, there could be a very large observation, with a very large error and even with log it would be larger than other errors and have more influence in the regression. ?But if I take the percent error to minimize, this observation with large error would not have a larger influence.

Best regards, Andr?