Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bass_f, the derivative of bass_F, in not calculated correctly #30

Open
fobos3 opened this issue Oct 1, 2021 · 1 comment
Open

bass_f, the derivative of bass_F, in not calculated correctly #30

fobos3 opened this issue Oct 1, 2021 · 1 comment
Labels

Comments

@fobos3
Copy link

fobos3 commented Oct 1, 2021

The bass f function, which is the derivative of F, is calculated using a time interval of 1. This yields inaccurate results.

> bass_f
function (Time, p, q) 
{
    ifelse(Time == 1, bass_F(Time, p, q), bass_F(Time, p, q) - 
        bass_F(Time - 1, p, q))
}

The f function has a closed form equation that should be used instead of the inaccurate numerical differentiation with such large time interval:

(p+q)^2 / p * exp(-(p+q)*20) / ( 1 + q / p * exp(-(p+q)*20))^2

Alternatively, one can simply substitute into the differential equation for F:

f = (1 - F) * (p + q * F).
@gvegayon gvegayon added the bug label Oct 18, 2021
@gvegayon
Copy link
Member

Thanks for reporting. Would appreciate a Pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants