Python Forum
Need advice on simple equation - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Need advice on simple equation (/thread-35117.html)



Need advice on simple equation - thunderspeed - Sep-30-2021

Hello everyone,

I believe my following question would be simple to you, but I need some direction since things need confirmation after reading throughout the internet.

I have the following equation:

Y[int(i-start_of_day_instant)] = (I0 * np.sin((h[int(i-start_of_day_instant)])) * (c0 + (c1 * C[int(i-start_of_day_instant)]) + (c2 * (C[int(i-start_of_day_instant)]**2)) + (c3 * ((D[int(i-start_of_day_instant)]) - (D3[int(i-start_of_day_instant)]))) + (c4 * R[int(i-start_of_day_instant)]) + (c5 * (V[int(i-start_of_day_instant)]))) + d)/k

I have a data set for variables values vs output Y.
And my goal is to find the values for the coefficients, c0 to c5 as well as d, I0 and k. So that later on, I can use this equation to predict the value of Y by substituting values of C,D,D3,R and V.
I first tried to approximate that as a multilinear regression problem and used the matrixes operations to find the coefficients but they yielded some non sense results at substitution.
Any advice how I can tackle this would be appreciated.
Thanks


RE: Need advice on simple equation - Larz60+ - Sep-30-2021

formatting your math will make it a lot easier to read, always use bbcode tags.
Y[int(i - start_of_day_instant)] = (
    I0
    * np.sin((h[int(i - start_of_day_instant)]))
    * (
        c0
        + (c1 * C[int(i - start_of_day_instant)])
        + (c2 * (C[int(i - start_of_day_instant)] ** 2))
        + (
            c3
            * ((D[int(i - start_of_day_instant)]) - (D3[int(i - start_of_day_instant)]))
        )
        + (c4 * R[int(i - start_of_day_instant)])
        + (c5 * (V[int(i - start_of_day_instant)]))
    )
    + d
) / k