How to translate this function into matlab?
Ältere Kommentare anzeigen
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!
Antworten (0)
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!