sgd
sgd copied to clipboard
SGD with arbitrary function for likelihood and gradient
Is there a way to use the sgd package for a maximum likelihood estimation that does not fit into one of the statistical families? . I see that there is some placeholder source code for a sgd.function method, and I was wondering if there was a way to use sgd with arbitrary functions for the likelihood and derivative of the likelihood?
You can look at the method of moments example in the repo. It implements a gradient function which is passed into SGD. This can be useful for simple prototyping, bu in general, we don't recommend using a arbitrary R function as it's quite slow in practice: it forces C++ to call an R subprocess at each iteration of training.