LoslegenKostenlos loslegen

Estimate parameter lambda

In the video you learned how the log link function provides for the linear combination in the parameters defining the Poisson regression model of the form

$$ log(\lambda)=\beta_0+\beta_1x_1 $$

To obtain the response function in terms of lambda we exponentiated the model function to obtain

$$ \lambda=E(y)=exp(\beta_0 + \beta_1x_1) $$ $$ \lambda=E(y)=exp(\beta_0) \times exp(\beta_1x_1) $$

In this exercise, you will use this formulation with the horseshoe crab data to compute the estimate of the mean \(y\) for the female crab width.

Dataset crab is preloaded in the workspace.

Diese Übung ist Teil des Kurses

Generalized Linear Models in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Import libraries
import ____.____ as sm
from ____.formula.api import ____

# Fit Poisson regression of sat by width
model = ____('____ ~ ____', data = ____, family = ____.____.____).____

# Display model results
____(model.____)
Code bearbeiten und ausführen