I am predicting the balance of credit card.
Such target has two peaks.
For those who never or seldomly use the card, the balance would be
close to zero, while for the others, the distribution would be
somewhat follow normal distribution.
The finite mixture model was used here with proc nlmixed. (exponential
distribution plus normal distribution with weight). Does it make
sense?
The code i used:
proc nlmixed data = Sample Tech=CONGRA;
parms b0 =0.00044 b1 = 0 a0 = -0.03 a1 = 0
logmu1 = 0 logsd2 = 0.5;
logit_p1 = b0 + b1*HST39X; /** HST39X is indep variable **/
p1 = exp(logit_p1)/(1+exp(logit_p1)); /** p1 is the probabiltiy being
inactive **/
p2 = 1 - p1;
mu1 = exp(logmu1);
lambda = mu1**(-1);
mu2 = 0.23+sqrt((a0+a1*loc_d1k)**2); /** loc_d1k is indep variable **/
v2 = exp(2*logSD2);
pi = constant('PI');
loglike = log(p1*exp(log(lambda)-lambda*&dep.)
+p2*exp(-0.5*(log(2*pi) + (&dep.-mu2)**2/v2+log(v2)))
);
model &dep. ~ general(loglike);
estimate "mu1" mu1;
estimate "mu2" mu2;
run;
The Warning Note:
WARNING: The final Hessian matrix is not positive definite, and
therefore the estimated covariance matrix is not full rank and may be
unreliable.