MATLAB Answers

inverse gaussian distribution NaN values

5 ビュー (過去 30 日間)
Rini 2015 年 3 月 3 日
I am working on a non-negative Bayesian Lasso model (<>) and I am sampling values from Inverse Gaussian distribution. Since I want only positive coefficients, I am using first 'mvnrnd' to generate the coefficients and then setting the negative values to 0. This is causing problem in the next steps where I use
with (e.g.) x 0.226 and y as 2.26e-19. with these parameters 'randraw' returns NaN values. The code for sampling inverse Gaussian is provided below-
Mu_tau = lambda2.*sqrt(Sigma2)./Beta;
Lambda_tau = lambda2.^2;
A_tau = Lambda_tau./(Mu_tau.^2);
tau2_temp = zeros(M,1);
for m = 1 : M
tau2_temp(m,1) = randraw('gig',[-1/2,Lambda_tau(m),A_tau(m)],1);
tau2 = (1./tau2_temp)';
where Beta is the non negative coefficient, M is the number of regressors and lambda is the LASSO penalizing vector. I have found other papers on Bayesian Lasso which works fine for me if I remove the non negative constraint. But with the constraint I always have this problem. Can someone help me? Sorry if my question is too long.

回答 (0 件)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by