I want to resolve the “Error in diag(vcov(object)) : long vectors not supported yet: array.c:2192” error - lme4

I have done a multiple regression analysis in lmer.
So I wanted to calculate the confidence interval of the partial regression coefficient using confint(), and when I enter the following code, I get an error "
> confint(H2_FULL, method="Wald")
***Error in diag(vcov(object)) :
long vectors not supported yet: array.c:2192***
" and cannot run it.
Does anyone know how to resolve this error? Please help.
I am a beginner in R. I would appreciate it if you could help me to understand it clearly.
I only need to be able to calculate 95% confidence intervals for the partial regression coefficients of multiple regression analysis(multi-model).
I assume four explanatory variables, which is why I think this error was made.
This error did not occur in the single regression analysis.

Related

convergence code 1 (glmer model, lme4 package)

I'm running a glmer model with a three-way interaction, which causes me to receive the following warning:
Warning:
In optwrap(optimizer, devfun, start, rho$lower, control = control, :
convergence code 1 from nlminbwrap
The warning is not there when the 3-way interaction is omitted, so I suspect it has to do with model complexity.
Unfortunately, there is no further information about the nature of the convergence issue in the warning (and also not in the model summary), which makes it hard to resolve. [I've tried different optimizers and increasing the nr of function evaluations already].
Is there any way of finding out what precisely convergence code 1 means? Also, I'm wondering whether it is as serious as when it says Model failed to converge? I've been looking for an answer in the R help pages and in the GLMM FAQs, but can't seem to find any. Any help is much appreciated!
Okay, so I've done some reading here with the hope of being able to help out a fellow linguist. Let's start with the model you specified in the comments:
model=glmer(Correct_or_incorrect~ (condition|CASE) + condition + sound + syll + condition:sound + condition:syll + syll:sound + condition:sound:syll, dataMelt, control=glmerControl(optimizer="nlminbwrap"), family = binomial)
The warning message code didn't say anything useful, but convergence code 1 from bobyqa at the very least used to be about exceeding the maximum number of function evaluations. How high did you try and go with the iterations? All you're going to lose is a few hours, so I would try and set it really high and see if the warning message goes away. All you'd be losing is computer time, and I personally think that's a small price to pay for a model that doesn't throw warnings.
You also mentioned that the warning was not there when the 3-way interaction is omitted, and I would be inclined to think that you are right concerning model complexity. If you don't have any specific hypotheses about that interaction I would leave it out and be done, but if you do, I think there are a few options that you haven't mentioned that you have tried yet.
There is a function called allFit() that will fit the model with all available optimizers. This would be a quick and easy way to see if your estimates are roughly the same among all the different optimizers. You run it on an already fitted model, like this:
allFit(model)
There is a good walkthough of using allFit() and it's different arguments here:https://joshua-nugent.github.io/allFit/ This page also has a lot of other potential solutions to your problem.
If you can, I would take advantage of a machine with multiple cores and run allFit with as many iterations as you can swing, and see if any of the optimizers don't give this warning, which is presumably about not minimizing the loss function before the iterations run out.

What is the difference between error function and loss function in deep learning?

I was reading about difference between error function and loss function in other questions but I didn't got the clarity what's the exact distance. In laymen term what I understood is error function is used to calculate the distance between predicted and actual output, and loss function is mean of that error function.
Kindly correct if I am wrong. An mathematical answer will be highly appreciated.
Consider an example of root mean squared error which is an error function used to find the difference between actual value and predicted value.
mean squared loss function is used to find the least error in the mean squared error in the given heuristic state space (list of possible models).

How to get the accuracy of classifier on test data in DeepLearning

I am trying to use DL4J for deep learning and have provided the training data with the labels. I am then trying to send a test data by assigning a dummy label. Without providing a dummy label, it gives runtime error. I dont understand why we need to assign label to test data.
Additionally, I want to know what is the accuracy of the prediction made. From what I saw in the dl4j docs, there is something known as a confusion matrix which is generated. I understand that this just gives us an idea of how well the training data has trained the system. Is there a way to get the accuracy of prediction on test data? Since we are giving a dummy label for the test data, I feel that the confusion matrix is also not generated correctly.
First, how can you test if the network outputs the correct labels if you don't know what the correct labels are? You should always have a labels when training and testing because that way you can assert if the output is correct.
Second question, I've found this on dl4j webpage:
Evaluation eval = new Evaluation(3);
INDArray output = model.output(testData.getFeatures());
eval.eval(testData.getLabels(), output);
log.info(eval.stats());
There is stated that this .stats() method displays the confusion matrix entries (one per line), Accuracy, Precision, Recall and F1 Score. Additionally the Evaluation Class can also calculate and return the following values:
Confusion Matrix
False Positive/Negative Rate
True Positive/Negative
Class Counts
F-beta, G-measure, Matthews Correlation Coefficient and more
I hope this helps you.
You may find people who can respond to your question in the DL4J dev community here: https://gitter.im/deeplearning4j/deeplearning4j/tuninghelp

Error in solve.default(res$hessian*n.used,A): 'a' must be a complex matrix

I am using the arima function in R's forecast package and I get the following error:
Error in solve.default(res$hessian*n.used,A): 'a' must be a complex matrix
The time series that I am fitting has very large values numbers e.g. greater than 10 million. Can anyone please provide a solution that might alleviate this error? Would scaling the time series help?

lmer Get p values from anova

lmerTest was designed as a wrapper to permit estimation of p-values from lmer mixed model analyses, using the Satterthwaite estimate of denominator degrees of freedom (ddf). But lmerTest now appears to be broken. It presently returns a message that there was an internal calculation error and returns only the lmer result (with no p-values). I have been able to calculate the p-values from the summary() function, using Dan Mirman's excellent code for calculating the Kenward-Rogers estimate of ddf. But I can't find equivalent code to calculate the p-values in an anova call on the lmer model. I suspect that one just needs to feed anova() a ddf, but I can't figure out how to do that.
Thanks in advance to anyone that can suggest solutions for this problem.
Larry Hunsicker
lmerTest returns the anova output of lme4 package whenever some computational error occurs in getting the Satterthwaite's approximation (such as e.g. in calculating the asymptotic variance covariance matrix). The lmerTest is not broken, it is just that there could be examples when the Satterthwaite's approximation cannot be calculated. In my experience this occurs not often.