Ad.test() for weibull distribution

Hi, I am newbie using R, I am trying to make the tests of goodness of fit to a group of data with some distributions, I have been reading and for Anderson Darling test y found can be made using ad.test but it works perfectly with norm distribution, if the distribution param is changed, y shows an error, Y am trying to use it by rpy2 library from python, this is my code:

import rpy2.robjects as R
import statistics as stats

R_ad_test = R.r['ad.test']
vector = R.IntVector([1, 2, 3, 1, 2, 7, 6, 8])
data = {
'min': min(item),
'max': max(item),
'mean': stats.mean(item),
'deviation': stats.pstdev(item)
}
R_ad_test(vector, 'weibull', mean=data['mean'] sd=data['deviation'])

finally the program shows me the following error:

R[write to console]: Error in F0(x, ...) :
unused arguments (mean = 3.75, sd = 2.63391343821318)

Traceback (most recent call last):
File "tesis.py", line 45, in
stat, p_val, method, name = u.make_test(vector, 'weibull', data['media'], data['deviation'])
File "/home/yordan/Escritorio/tesis/version1/utils.py", line 60, in make_test
return R_ad_test(data, distribution, mean=mean, sd=deviation)
File "/home/yordan/Escritorio/tesis/version1/venv/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 197, in call
return (super(SignatureTranslatedFunction, self)
File "/home/yordan/Escritorio/tesis/version1/venv/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 125, in call
res = super(Function, self).call(*new_args, **new_kwargs)
File "/home/yordan/Escritorio/tesis/version1/venv/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py", line 44, in _
cdata = function(*args, **kwargs)
File "/home/yordan/Escritorio/tesis/version1/venv/lib/python3.8/site-packages/rpy2/rinterface.py", line 624, in call
raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in F0(x, ...) :
unused arguments (mean = 3.75, sd = 2.63391343821318)

Can someone help me?

suppressPackageStartupMessages({library(nortest)})
ad.test(c(1, 2, 3, 1, 2, 7, 6, 8))
#> 
#>  Anderson-Darling normality test
#> 
#> data:  c(1, 2, 3, 1, 2, 7, 6, 8)
#> A = 0.53538, p-value = 0.1165

Created on 2020-09-20 by the reprex package (v0.3.0.9001)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.