BookmarkSubscribeRSS Feed
Pyrite | Level 9

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	;
	PARMS HazardRate;
	BOUNDS HazardRate<=1;
	fit PredictedPrice start=(HazardRate=0.01) /   OUTPREDICT  OUTEST=predictedhr;

and hr defined like 

%global j;

%macro hr(n);
	%do i=1 %to &n;
 		%let j=%eval(&i-1);
	 	%if &j=0 %then %do;
		 %else %do;

So how can i define this equation? Is there any way? 

RecoveryRate - parameter

Spread - fixed

Thank you,



SAS Employee

If you want to estimate unknown parameters in PROC MODEL using nonlinear regression, you need to have an equation in the form:


y = f(x,theta) + epsilon


where y is the dependent variable, x's are the exogenous variables, theta is vector of parameters to be estimated, epsilon is the error term. Your input data should contain columns of y and x's, and you write out the equation for f(x,theta) explicitly, then specify the y variable on the FIT statement. 


I am afraid it is not clear to me what your equation y = f(x, theta) + epsilon is. If you can first write out the functional form y = f(x,theta) + epsilon explicitly mathematically, then you can write out the f(x, theta) explicitly in PROC MODEL. If your goal is not to estimate parameters from nonlinear regression, then please clarify on what your objective is.

SAS Employee


If you're new to PROC MODEL it can be difficult to know the best syntax to express your model.  I'd be happy to help if you could clarify what data you have and what you are trying to estimate.  If your data consists of many contract prices (price) then your FIT statement (ignoring extraneous options) would just be

fit price;

 How you write out the right hand side of your price model depends on how time, discount factors, amounts (remaining and real) are represented in your INUPUT data set (e.g. what are the rows and columns in your INPUT data set).  If you can specify these details it should be possible estimate your model.



Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 3 in conversation