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!