function [output] = f_loss_TVPSV(X,mod_params,loss_params)
    
    lower = loss_params.lower;
    upper = loss_params.upper;
    alpha = loss_params.alpha;
    beta  = loss_params.beta;
    w     = loss_params.w;

    sigma = sqrt(mod_params(:,end));
    mu    = X*mod_params(:,1:end-1)';

    DRf   = @(x) (((lower-x)).^alpha).*(normpdf((x - mu) ./ sigma));
    EIRf  = @(x) (((x-upper)).^beta).*(normpdf((x - mu) ./ sigma));

    DR  = quadgk(DRf,-Inf,lower);
    EIR = quadgk(EIRf,upper,Inf);
    BR  = w.*EIR - (1-w).*DR;

    output = [DR,EIR,BR];
end       