Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GWR poisson: local variable 'aicc' referenced before assignment #58

@ghost

Description

I used the following codes to do the bandwidth selection for GWR Poisson but got an error saying "local variable 'aicc' referenced before assignment"

import libpysal as ps
from mgwr.sel_bw import Sel_BW
import numpy as np
from spglm.family import Poisson
data = ps.io.open(ps.examples.get_path('GData_utm.csv'))
coords = list(zip(data.by_col('X'), data.by_col('Y')))
y = np.array(data.by_col('PctBach')).reshape((-1,1))
rural = np.array(data.by_col('PctRural')).reshape((-1,1))
pov = np.array(data.by_col('PctPov')).reshape((-1,1))
african_amer = np.array(data.by_col('PctBlack')).reshape((-1,1))
X = np.hstack([rural, pov, african_amer])
bw = Sel_BW(coords, y, X, kernel='gaussian', family = Poisson).search(criterion='AICc')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdoc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions