Skip to content

cdf of TDist with ForwardDiff.Dual errors #1334

@bdeonovic

Description

@bdeonovic
using ForwardDiff
using Distributions
x = ForwardDiff.Dual(7.0)
v = 4.0

TDist(v) ## works, obviously
TDist(one(typeof(x))*v) ## works
pdf(TDist(one(typeof(x))*v), x) ## works

cdf(TDist(v), x) ## error!
cdf(TDist(one(typeof(x))*v), x) ## error!

The latter with error:

ERROR: MethodError: no method matching tdistcdf(::ForwardDiff.Dual{Nothing, Float64, 0}, ::ForwardDiff.Dual{Nothing, Float64, 0})
Stacktrace:
 [1] cdf(d::TDist{ForwardDiff.Dual{Nothing, Float64, 0}}, x::ForwardDiff.Dual{Nothing, Float64, 0})
   @ Distributions C:\Users\yim583\.julia\packages\Distributions\cNe2C\src\univariates.jl:550
 [2] top-level scope
   @ REPL[18]:1
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

and

Distributions v0.24.18
ForwardDiff v0.10.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions