Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for methods #17

Merged
merged 9 commits into from
Jun 30, 2016
Merged

Add documentation for methods #17

merged 9 commits into from
Jun 30, 2016

Conversation

lokeshh
Copy link
Member

@lokeshh lokeshh commented May 9, 2016

Addresses #4

@lokeshh lokeshh changed the title Add documentation for methods [WIP] Add documentation for methods May 9, 2016
#
# @param [Symbol] as_a Specifies the form of output
#
# @return [Array, Hash] coefficients of the model
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this and some other methods it looks like, if as_a=:array is specified, then a Daru::Vector is returned, rather than an Array... Is that an issue? (If it is, I think that it can be a separate pull request though)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right it will need to be fixed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #19

@lokeshh
Copy link
Member Author

lokeshh commented May 15, 2016

log_likelihood defined here Could someone please explain what it does? I am little aware of the likelihood function but don't know how it's related here.

I read that Likelihood is a tool for summarizing the data’s evidence about unknown parameters. But here it doesn't take any input and returns a single value, so it's surprising me and I am not sure what its meant for.

@agisga
Copy link

agisga commented May 15, 2016

@lokeshh The log-likelihood is a function of the unknown parameters (such as the regression coefficients). The MLE (maximum likelihood estimation) algorithm aims to find values for the unknown parameters, at which the log-likelihood is maximized. I think here, log_likelihood is the optimal value of the log-likelihood function (i.e., the value of the log-likelihood function at the MLE solution).

It is useful, for example, if you fit two different models to the same data, and want to compare them. Then log_likelihood would be a metric for the goodness of the model. Similarly, you can arrive at the likelihood ratio test by taking the difference of the log-likelihood values of the two models.

@@ -74,6 +105,24 @@ def fitted_mean_values
@regression.fitted_mean_values
end

# Returns for every data point obtained using the model
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here is a typo. Do you mean "Returns the residual for (...)"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it.

@lokeshh lokeshh changed the title [WIP] Add documentation for methods Add documentation for methods Jun 30, 2016
@lokeshh
Copy link
Member Author

lokeshh commented Jun 30, 2016

I think it can be merged now. I haven't changed the method names in this PR because it was for documentation purpose. For that I have this PR which also refactor some code #28

@v0dro v0dro merged commit 0244bf1 into SciRuby:master Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants