I am trying to fit standardized reaction time data to an ex-gaussian distribution with gamlss. In most cases the below code works fine (see rt_std1) and outputs the required ex-gauss parameters. In some cases, however, I get the below error (see rt_std2).
rt_std1 <- c(0.213011811269023, 1.92445300764915, -0.560994546234345, -1.02440408372399, -0.587973594940306, -1.10671568383732, 1.11291476202265, -0.417919631742525, -0.14050582930459, -0.757132270121753, -0.640496793713083, -0.763641824807755, -0.685947626167377, 0.212302116787372, 0.197857615435093, 1.07428351369626, 1.07861893493265, 0.0996533247720669, -0.685431188118029, 0.207483816650771, 3.3669578297045, -0.386922022732427, -1.13780525848604, -0.443927470553766, 0.323991593371334, -0.525130651339695, -0.352411138495359, -0.927928773490475, 1.06450207178964)
rt_std2 <- c(0.345545275238159, 0.309626962780317, -0.70187210044566, -1.08690347491401, -1.10168696439348, -0.909524984312054, 1.01775790947214, 0.340657178815335, -0.529993112969592, -0.764584126553196, -0.00922185668918685, -0.83008895215349, -1.14481472537842, -0.588663379076581, -1.01503091174335, 0.00148661701480176, -0.895782761367292, 0.00612579748297889, -0.753608677897641, -0.0517377221848517, -0.696119494463954, -0.537010015055226, 2.89731858687397, 1.83962627791164, -0.551454608846664, 0.388891317865122, -0.385839810394556, 4.60294894444364, 1.54728747920665, 0.427928877965543)
The following call produces the intended result.
gamlss(rt_std1 ~ 1,
family = gamlss.dist::exGAUS(),
control = gamlss::gamlss.control(n.cyc = 400, trace = F))
GAMLSS-RS iteration 1: Global Deviance = 69.4127
GAMLSS-RS iteration 2: Global Deviance = 67.6171
GAMLSS-RS iteration 3: Global Deviance = 67.1232
GAMLSS-RS iteration 4: Global Deviance = 67.0248
GAMLSS-RS iteration 5: Global Deviance = 67.0067
GAMLSS-RS iteration 6: Global Deviance = 67.0024
GAMLSS-RS iteration 7: Global Deviance = 67.0014
GAMLSS-RS iteration 8: Global Deviance = 67.0013
Family: c("exGAUS", "ex-Gaussian")
Fitting method: RS()
Call: gamlss::gamlss(formula = rt_std1 ~ 1, family = gamlss.dist::exGAUS())
Mu Coefficients:
(Intercept)
-0.9994
Sigma Coefficients:
(Intercept)
-1.669
Nu Coefficients:
(Intercept)
-0.00971
Degrees of Freedom for the fit: 3 Residual Deg. of Freedom 26
Global Deviance: 67.0013
AIC: 73.0013
SBC: 77.1032
Whereas the call with rt_std2
throws the following error
gamlss(rt_std1 ~ 1,
family = gamlss.dist::exGAUS(),
control = gamlss::gamlss.control(n.cyc = 400, trace = F))
GAMLSS-RS iteration 1: Global Deviance = 77.0141
GAMLSS-RS iteration 2: Global Deviance = 74.2342
GAMLSS-RS iteration 3: Global Deviance = 73.2684
GAMLSS-RS iteration 4: Global Deviance = 71.7125
Error in glim.fit(f = sigma.object, X = sigma.X, y = y, w = w, fv = sigma, :
NA's in the working vector or weights for parameter sigma
Any suggestions on how to resolve this?
I checked the data for missing values or differences between the different reaction time data vectors, some of which worked and some of which didn’t. Also I tried to add some minor random noise to the non-functioning vectors, which resulted in a successful fit.