%TLASSO_FINDMAXTAU2 Determine the maximum regularisation parameter to use if n > p. 
% Users should refer to the 'tlasso' function to use this software.
function [tau2_max, b_ml, b0_ml, sigma2_ml, L_ml] = tlasso_FindMaxTau2(X, y, nu)

[~,p] = size(X);
[b_ml, b0_ml, sigma2_ml, L_ml] = tlasso_ML(X, y, nu);

tau2_max = 100*(sqrt(2)*sum(abs(b_ml))/p/sqrt(sigma2_ml))^2;

return