Hi All,
Overall i want to optimize my equations using Nelson Siegel to build Hazard Rate Curves through proc model. I have a problem to define the following equation:
HAZARDRate = Spread / (1 - RecoveryRate);
because i cannot calculate directly HAZARDRate, i don't have a formula, so i calculate it like implied HazardRate as you can see here
PROC model data=input MAXITER=&Maxiter CONVERGE=0.0000001 SINGULAR=0.0000001 MAXSUBIT=&Maxsubit NOITPRINT noprint ;
Price=sum(%hr(n=65));
PARMS HazardRate;
BOUNDS HazardRate<=1;
fit PredictedPrice start=(HazardRate=0.01) / OUTPREDICT OUTEST=predictedhr;
run;
quit;
and hr defined like
%global j;
%macro hr(n);
%do i=1 %to &n;
%let j=%eval(&i-1);
%if &j=0 %then %do;
(real_amount&i*exp(-HazardRate*tm_d&i/365)+remainingprincipal&i*((1-exp(-HazardRate*tm_d&i/365))*RecoveryRate))*df&i,
%end;
%else %do;
(real_amount&i*exp(-HazardRate*tm_d&i/365)+remainingprincipal&i*((exp(-HazardRate*tm_d&j/365)-exp(-HazardRate*tm_d&i/365)))*RecoveryRate)*df&i,
%end;
%end;
0
%mend;
So how can i define this equation? Is there any way?
RecoveryRate - parameter
Spread - fixed
Thank you,
Alexey