How to use Custom-defined link function with poisson regression
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Philip Caplan
el 13 de Abr. de 2015
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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!