Specify different distributions for different parameters in glmfit
이전 댓글 표시
Hi,
The parameters in my GLM model have different distributions. Some are normal, others are Poisson. I'm wondering whether I can specify distributions specific to a parameter. I know that I can specify my own distribution function, so I was thinking that maybe I can use my own function to select between the alternating parameters. But how would I know which parameter glm is fitting when it calls my function?
Thanks in advance.
답변 (2개)
Peter Perkins
2013년 5월 14일
In the usual notation and terminology, a GLM is specified as
mu(x) = E[y|x] = h(x*beta)
y|x ~ F(mu(x),phi(x))
where beta is a column of location parameters, phi is the dispersion parameter, x is a vector of predictors variables, y is the response variable, h is the inverse link function, and F is a distribution. beta and phi are unknowns to be estimated. That's the model that glmfit fits.
If you're thinking of those parameters as themselves having distributions, then that's a Bayesian model. That's fine, but it's not what glmfit does. Perhaps by "parameters", you mean something else?
Peter Perkins
2013년 5월 15일
> From my understanding, distr says how y changes as a result of changes in X
No. The distribution in a GLM describes the random variation in y. The link function and the regression coefficients (beta) describe how y depends on x. The distribution has no effect on how y depends on x, except that glmfit uses the csnonical link by default, so in effect, specifying a distribution also specifies the link.
Your original question asked about distributions on "parameters". One way to interpret that is that you meant that you want beta to be a random variable. That's a Bayesian approach, and glmfit doesn't do that. This:
> y|xi ~ Fi(...)
sounds like you want each element of the response vector to have a different distribution. If I understand your notation correctly, that's not a GLM either. But then you say
> Where the distribution with which y changes as a result of changes in x depend on x
and again, in a GLM, all of the dependency of y on x is captured by
E[y] = h(x*beta)
So I can't tell what you're asking. Sorry.
카테고리
도움말 센터 및 File Exchange에서 Binomial Distribution에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!