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

Exponential regression -- incorrect case #650

Open
andiejs opened this issue Nov 29, 2023 · 1 comment
Open

Exponential regression -- incorrect case #650

andiejs opened this issue Nov 29, 2023 · 1 comment
Labels

Comments

@andiejs
Copy link

andiejs commented Nov 29, 2023

Hello, my example cases for exponential regression are giving incorrect results. Would it be possible for someone to check the algorithm on this? (Wolfram alpha gives correct results on this data, so this failure shouldn't be inevitable.) Thank you!

let test_exp () =
  let x = Owl.Mat.uniform 50 1 in
  let a = 14.8494 in
  let l = -4.21473 in
  let b = 0. in
  let y = Owl.Mat.((a $* exp (-.l $* x)) +$ b) in
  let a', l', b' = Owl.Regression.D.exponential x y in
  Printf.printf "(%g, %g, %g) (%g, %g, %g)\n" a l b a' l' b'
   (* (14.8494, -4.21473, 0) (1.48675e-46, 3.03379e-16, 238.706) *)
@andiejs
Copy link
Author

andiejs commented Nov 30, 2023

This algorithm seems to work:
https://stackoverflow.com/a/61288871

@jzstark jzstark added the bug label Mar 7, 2024
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