You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
/// <summary>/// Computes the Basic Spline of order <c>n</c>/// </summary>publicstaticdoubleBSpline(intn,doublex){// ftp://ftp.esat.kuleuven.ac.be/pub/SISTA/hamers/PhD_bhamers.pdf// http://sepwww.stanford.edu/public/docs/sep105/sergey2/paper_html/node5.htmlif(n== Int32.MaxValue)thrownew ArgumentOutOfRangeException("n");doublea=1.0/ Special.Factorial(n);// <= preloading the 1/n!... okdoublec;boolpositive=true;for(intk=0;k <= n+1;k++){c= Binomial(n+1, k)* Tools.TruncatedPower(x+(n+1.0)/2.0-k, n);a+=positive?c:-c;// <= Then here you sum the n+1 parts of the formula which shouldn't be added to the 1/n! preloadpositive=!positive;}returna;// <= returned "a" which does not correspond to the stated formula}
Code should look like this :
/// <summary>/// Computes the Basic Spline of order <c>n</c>/// </summary>publicstaticdoubleBSpline(intn,doublex){// ftp://ftp.esat.kuleuven.ac.be/pub/SISTA/hamers/PhD_bhamers.pdf// http://sepwww.stanford.edu/public/docs/sep105/sergey2/paper_html/node5.htmlif(n== Int32.MaxValue)thrownew ArgumentOutOfRangeException("n");doublea=0.0;// Preload a with 0doublec;boolpositive=true;for(intk=0;k <= n+1;k++){c= Binomial(n+1, k)* Tools.TruncatedPower(x+(n+1.0)/2.0-k, n);a+=positive?c:-c;// Sum terms over kpositive=!positive;}return1.0/ Special.Factorial(n)*a;// Finally apply the 1/n! factor}
What do you think ? I hope I'm not misunderstanding anything...
The text was updated successfully, but these errors were encountered:
It seems that there is an error in the BSpline function in the Special.cs file.
There may be a mismatch between the definition stated here : http://crsouza.com/2010/03/kernel-functions-for-machine-learning-applications/#bspline and the implementation on the Special class.
Original code :
Code should look like this :
What do you think ? I hope I'm not misunderstanding anything...
The text was updated successfully, but these errors were encountered: