Closed AZM999 closed 1 year ago
@pr0m1th3as sure i will add the documentation BISTs and fix the coding style .
actually matlab examples given on the site you mentioned import builtin dataset from Matlab. should i copy the data from the variables into the code or use available data sets in Octave(any suggestions) . also can we copy MATLABs examples directly ?
These data sets are available in the statistics package as well.
Do not add your demos as verbatim copies, just write your code to produce the same result. Obviously it won't differ much since you are working with the same data set. It is also useful to add some comment so that the user understands better the demos. If you have access to MATLAB, make sure that your try all options with various inputs so that you can verify that your implementation works as expected under all circumstances.
It is also helpful to add some comment inside the function to clarify what each code block is doing. See some other functions to get an idea. Actually look at the poissfit
new function that I pushed yesterday.
Any updates on the requested changes?
@pr0m1th3as apologies for my inactivity as my pre-final year’s University exams are going on currently .
I have added the help text and BISTs for the implemented function. I was trying to add example/ demo for the function but it seems that either the builtin dataset that i am using has some difference from matlab or my function is missing something that is causing it to through an error for passed parameter.
submit your changes on top of this PR so I can review them and help you with the error
@pr0m1th3as
Added the changes you requested from our earlier conversation , I tried adding the Example using the builtin dataset carbig
based on the matlab documentation but it gives an error for vertical dimension mismatch in my code.
before my first commit i tested the function by copying the raw data for the values from 'carbig' dataset and that time it worked.
please review the code and suggest changes to fix this
See my latest commit
Can you make another DEMO with the acetylene dataset?
Make sure you commit you new changes on top of this PR, so we can keep track of the function's development
@pr0m1th3as Closed the last pr and created a stacked pr on top of this pr to reflect changes, please review and suggest changes if any
I have merged this PR and made certain modifications in the coding style, input validation and BISTs, as well as restructured the help texinfo docstring. Please, see the changes I've made so you can adopt them to your coding practices while you are contributing to the statistics package. There are still a few things to work on this function, which I leave them to you. More specifically, you need to add testing blocks under the comment ##Test output to make sure it produces the exact same numbers as MATLAB does. Also, add some comment in the demo code so that the user can better understand how to use this function. I've merged it, so I can produce the online documentation for this functions. Once you make the aforementioned improvements, make a new PR. This can remain closed.
New function ridge with input parameters (y,X,k,flag) that returns the regression coefficients or performs ridge regression of the vector y on the regressor X using ridge parameter k and flag for scaling indications.