MATLAB Answers

inverse gaussian distribution NaN values

5 ビュー (過去 30 日間)
Rini
Rini 2015 年 3 月 3 日
Hello,
I am working on a non-negative Bayesian Lasso model (<http://arxiv.org/pdf/1009.2300v1.pdf>) 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
randraw('gig',[-1/2,x,y],1);
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;
Mu_tau(Mu_tau>1e10)=1e9;
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);
end
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.
Thanks

回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by