jstriaukas / midasmlpy

Python implementation of the midasml approach
GNU General Public License v2.0
20 stars 8 forks source link

Orthogonal polynomials #2

Open jstriaukas opened 2 years ago

jstriaukas commented 2 years ago

Create a function that computes Legendre & Gegenbauer polynomials.

Examples: https://github.com/jstriaukas/midasml/blob/master/R/midas.polynomials.R

slim-patchy commented 2 years ago

Let me start on this issue first

slim-patchy commented 2 years ago

Code for orthogonal polynomials added to codebase, now at https://github.com/jstriaukas/midasmlpy/blob/master/midasmlpy/midas_polynomials.py. Will add test cases next.

jeremylhour commented 1 year ago

Hi, I think there is a bug in the lb function particulalry at https://github.com/jstriaukas/midasmlpy/blob/9d35a407afea3586e1b98e8681e5137e71b819e2/midasmlpy/src/midas_polynomials.py#L44 You will likely get a dimension error because a scalar multiplies a vectors with @ instead of Psi[:, i] = np.sqrt((2i + 1) / (b-a)) @ P[:, i]

jstriaukas commented 1 year ago

Thanks a lot, Jeremy. We will try to fix it ASAP.

krisstern commented 1 year ago

Bug fixed.

See: https://github.com/jstriaukas/midasmlpy/blob/3d69833e1680fe5d5f2d075890cf8c897ba4f8c1/midasmlpy/src/midas_polynomials.py#L44