Skip to content

Derivatives seem ok but result is not as expected: pls help, can't complete the course for this! #4

Closed Answered by TheKidPadra
zahrafarajih asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, zahra, if you still want to know why your original derivatives were wrong, here is a full explanation. It a mistake was made, it deserves to be investigated why it was a mistake. That's how progress is made.

df / dμ

I don't know what you got from the online derivative calculator, below is what I got by differentiate f with respect to μ by hands:

Hence, the partial derivative with respect to μ can be simplified to:

In Python, the partial derivative with respect to μ would look like:

def dfdmu (x,mu,sig) :
    return f(x, mu, sig) * (x-mu)/(sig**2)

Compare the above with your original code, which you stated in the post here, you would immediately know why your original answer was wrong.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zahrafarajih
Comment options

Answer selected by zahrafarajih
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants