It seems it is not available from CRAN anymore, but you can get it from here:

https://github.com/jalapic/engsoccerdata#installation

I will see if i can remove the dependency soon, but for now, you need to install it from github.

]]>Thanks

David

The reason I define expected goals that way is because it more closely resembles the commonly used Generalized Linear Models framework.

I cant know exactly why you got that error, but my guess would be that the optimizer encounters some negative parameter values that gives negative expected goals, which causes the error.

One trick to avoid this is to tranform the parameter using exponentiation during optimization, and use addition instead of multiplication. And that is one reason I formulated the expected goals like that. The two approaches should be equivalent, so you can exponentiate the parameter values you get from my approach and get the multiplicative parameters like in the paper.

]]>Is there a particular reason why you have chosen to define expected goals this way? I have been attempting to alter your code to match as closely to Dixon & Coles paper as possible, however I get the error

Error in optim(par = unlist(parameter_list), fn = dc_negloglik, goals_home = data$hgoal, :

non-finite finite-difference value [40]

Do you come across this and opt to use exp(a+b) as a result?

]]>You can find the adress in the package DESCRIPTION file, which you also can see on github.

]]>Yes, I forgot to mention, you need to install the very latest version of the package from github (just run the installation command again). I found the same bug bug when I wrote the tutorial. Thanks for letting me know anyway!

]]>Thanks for your reply. I ran the entire code again but I got this error message

“any(observed <= ncat)"

Looking at your code, line 556, I tried removing the condition and it worked for me. I got the same results as in your example.

I just want to let you know.

]]>The entire purpose of the goalmodel package is to solve (or estimate) the hfa, attack and defense parameters. The same page you copied the text from is a tutorial on how to do it.

]]>I added some example code in the readme on github:

https://github.com/opisthokonta/goalmodel#evaluating-predictions