function val = getStartingValues_jsz(L,Y,WN, mats)
%  obtain starting values for lamQ for MLE
%   -> random seeds for Q-eigenvalues
%       
%   Arguments: L
%   Value: list with starting values
%   global Y WN mats ;

if isempty(L) 
    disp('L needs to be provided')
end
Omega_cP = L * transpose(L) ;
nSeeds = 500;  % how many random seeds to try
best_llk = Inf(1) ;

for i = 1:nSeeds
    runif = 0.1*rand(3,1) + 0 ;
    lamQ = 1-abs(sort(runif)) ;
    res_llk = jsz_llk(Y, WN, diag(lamQ-1), [], [], [], Omega_cP, mats, 1, [], 0, [],[],[],[],[]) ;
    llk = sum(res_llk.llk) ;
    if llk < best_llk
        %disp(['Improve seed llk to  ', num2str(llk)]);
        best_llk = llk ;
        best_lamQ = lamQ ;
    end
end

val.lamQ = best_lamQ ;
val.L = L ;


% %    nSeeds = 500;  % how many random seeds to try
% %    best_llk = Inf(1) ;
% %    for i = 1:nSeeds
% %        runif = 0.1*rand(R,1) + 0 ;
% %        lamQ = 1-abs(sort(runif)) ;
% %        res_llk = jps_llk(Y, Mo, W, R, diag(lamQ), [], [], [], Omega_Z, mats, 1, [], 0, [], [], []) ;
% %        llk = sum(res_llk.llk) ;
% %        if llk < best_llk
% %            disp(['Improve seed llk to  ', num2str(llk)]);
% %            best_llk = llk ;
% %            best_lamQ = lamQ ;
% %        end
% %    end
% best.lamQ <- c(0.9971, 0.9650, 0.8868)

% best_lamQ = [0.997, 0.95, 0.9] ; 
% best_lamQ = best_lamQ ;
% 
% val.lamQ = best_lamQ ;
% val.L_Z = L_Z ;

end