How to use Custom-defined link function with poisson regression
7 次查看(过去 30 天)
显示 更早的评论
I want to use Poisson regression on a model that looks like following:
y = a * b^X1 * X2^c
Where a, b and c are constants.
I assume that I need to use 'glmfit' and make use of a link function, but I dont know how to write the code to get it right.
0 个评论
回答(1 个)
Philip Caplan
2015-4-13
From my understanding of the question, it seems you would like to model the average, mu, of a response, y, to input variables, X, with a Poisson distribution. For a Poisson regression, the model is transformed with the log link:
log(mu) = beta1 +Z1*beta2 +Z2*beta3
where
beta1 = log(a)
beta2 = log(b)
beta3 = c
Z1 = X1
Z2 = log(X2)
with a, b, c, X1, X2 corresponding to your variables. You can then use "glmfit" (or "fitglm") with 'Distribution' as 'Poisson' and 'Link' as 'Log' with the above transformation to get the desired result. For more information, please see:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!