indeed, I didn’t duplicate the weights, and that was the problem. Thanks for your help!

]]>First of all, thank you very much for your work and for sharing your knowledge with us.

I have implemented a Poisson Model using you example http://opisthokonta.net/?p=296 and wondering if I can apply DCweights to it? I have a feeling it is possible because I see you can do it using your goalmodel package:

gm_res_w <- goalmodel(

goals1 = england_2011$hgoal,

goals2 = england_2011$vgoal,

team1 = england_2011$home,

team2=england_2011$visitor,

weights = my_weights

)

But I don't understand where to pass them. I thought I need to pass them to the glm function like this

glm(

goals ~ home + team + opponent,

family = poisson(link = log),

data = goal_model_data,

weights = my_weights

)

but it throws an error

Error in model.frame.default(formula = goals ~ home + team + opponent: invalid type (closure) for variable '(weights)'.

Could you please help me to understand how to use weights with the independent Poisson Model? Or it's only possible to do it with DC approach?

Thanks in advance!

]]>You can see a detailed description of the basic structure of all the models, including the Dixon-Coles model, in this section of the readme: https://github.com/opisthokonta/goalmodel#the-default-model

]]>Its just a matter of multiplying the weights with each term in the (negative) log-likelihood (dc_negloglik() in the “simple implementation”) before you sum them.

]]>I looked but could not find anything on this.

]]>Please can I ask what the parameter ‘Intercept’ is used for when using the Dixon-Coles option in the goalmodel package ? ]]>

Yesterday I managed to stay concentrated long enough to get your second (more recent) Dixon-Coles implementation to work with my international soccer matches data set. Basically I had to make sure that every pair of team names in the data-set, both home and away, matched with a team name in “all_teams”. I could not have, for example, a home team in the data-set that matched with a team name in “all_teams” but the corresponding away team name in the data-set not appearing in “all_teams”. This obviously reduced the size of the data-set. Ordinarily I would not “throw away” data that may be useful.

I had already been careful to match up argument names used in optim with those defined in dc_negloglik.

]]>