Fitting a student t distribution in R using fitdistr() yields error “non-finite finite-difference value” -


reproducable example give mentioned error code every time is: (note without set.seed, error comes every time)

library(mass) set.seed(seed = 1) data<-rnorm(n = 10000,mean = 0.0002,sd = 0.001) fitdistr(x = data,densfun = "t") 

the error message is:

error in stats::optim(x = c(-0.000426453810742332,       0.000383643324222082,  :  non-finite finite-difference value [2] in addition: warning message: in log(s) : nans produced 

the problem "non-finite finite-difference value". fitdistr not give me result.

my knowledge: researched , apparently mean parameter negative during iteration. , solution provide better or @ least different starting value. not figure out how , not sure if issue.

my question: a) why error message , b)how can fix in r, can fit student-t distribution distributed data?


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -