Я работаю над небольшим проектом QRM в RStudio, и у меня возникла следующая проблема: когда я хочу наложить красную линию, чтобы показать плотность заполнения, я получаю следующее сообщение об ошибке:
"Error in plot.xy(xy.coords(x, y), type = type, ...) :
graphical parameter "lend" has the wrong length"
У вас есть мой код ниже.Не могли бы вы помочь мне понять, что происходит?
Спасибо!
# Fit a Student t distribution to djx
tfit <- fit.st(djx)
# Define tpars, nu, mu, and sigma
tpars <- tfit$par.ests
nu <- tpars[1]
mu <- tpars[2]
sigma <- tpars[3]
# Plot a histogram of djx
hist(djx, nclass = 20, probability = TRUE, ylim = range(0, 40))
# Compute the fitted t density at the values djx
yvals <- dt((djx - mu)/sigma, df = nu)/sigma
# Superimpose a red line to show the fitted t density
lines(djx, yvals, col = "red")