Open mauimuc opened 8 years ago
Probably changing the underlying 'basis' to gamma will improve the fit. This relies on some changes in the PDQutils package, which I am still working on. Thanks for submitting the issue; I will get to this.
to wit:
require(sadists)
require(PDQutils)
# compute cumulants
cumuls <- sadists:::sumchisqpow_cumuls(wts=1,ncp=0,df=1,pow=1,order.max=5)
# turn into raw moments
moms <- PDQutils::cumulant2moment(cumuls)
# use the Gram Charlier with 'gamma' basis:
x <- seq(0,1,len=500)
plot(x, dchisq(x=x, df=1), type='l', col='green', ylim=0:1)
lines(x, dapx_gca(x=x,raw.moments=moms,support=c(0,100),basis='gamma'))
With ncp=0 and pow=1 the non-central becomes the central chi-square. However, for small degrees of freedom
dsumchisqpow
yields weird values.Simply try
for a comparison. I just realized that
order.max
has a huge impact. I runsadists
0.2.1.