function NLL=NLLLS(Bet,Y,Bss);
%**************************************************************************
%Illustration of non-stationary extreme value modelling in MATLAB accompanying 
%Threshold modeling of nonstationary extremes
%Paul Northrop, Philip Jonathan and David Randell
%in 
%Extreme Value Modeling and Risk Analysis: Methods and Applications
%Dipak Dey and Jun Yan (Editors)
%2015
%**************************************************************************

%**************************************************************************
%NEGATIVE LOG LIKELIHOOD FOR GAUSSIAN
%
%Bet     2p x 1 Spline parameter vector
%Y        n x 1 Responses
%Bss      n x p Spline basis evaluated at the covariate values corresponding to responses
%
%NLL      1 x 1 Negative log likelihood
%**************************************************************************

NLL=sum((Y-Bss*Bet).^2);