How to translate this function into matlab?
Mostrar comentarios más antiguos
Hello everyone, I am trying to translate this R function to compute the pseudo-R-squared in MATLAB. I did
rho <- function(u,tau=.5)u*(tau - (u < 0))
V <- sum(rho(f$resid, f$tau))
I did the following, but I get the error: "Array indices must be positive integers or logical values."
function rho = TickFunction(u,tau)
%Tick function to evaluate a quantile regression model performance
%u is the residuals of the fitted model
%tau is the quantile of interest
rho = u(tau - (u<0));
end
Anyone could help?
Thanks!
Respuestas (0)
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!