[R-sig-ME] Negative Variance
Ben Bolker
bbolker at gmail.com
Tue Jun 4 23:28:46 CEST 2013
Callie Baird <calliebaird at ...> writes:
>
> I would like to analyze the results of allowing negative variance as part
> of a simulation study, to understand if and how the negative variance
> cases
> differ from the convergent cases.
>
> If there is no way to do so already written, does anyone have
> an idea how I
> might alter the code to allow negative variance estimates?
>
> Thanks,
>
> Rachel Baird
1. I assume you don't mean that you're going to simulate with
negative variances (since, even accepting Jarrod's arguments about
when a negative _estimate_ of variance would be meaningful, it would
be hard to imagine a sensible way of _simulating_ with negative
variances) ... if you're doing a simulation that includes cases with
negative variance estimates, that presumably means that you're going
to be exploring fitting as done by some software package (AS-REML,
SAS) that _does_ allow fitting of negative variances. If so, why not
use those packages?
2. As discussed elsewhere in this thread, negative variance estimates
would typically correspond to a case of negative within-group
correlations. You can see whether the correlation parameter is
negative by fitting with pdCompSymm() (again, as mentioned elsewhere)
-- that would probably correspond to "negative variance cases" as
estimated by some other packages. To me this seems reasonable, and
very much your best bet if you are going to stick with R and
nlme/lme4.
3. It would be **very difficult** to modify the nlme or lme4 code to
allow for negative variances -- they're simply not set up in a way
that allows that case to make any sense. lme4's code would probably
(figuratively) blow up if you tried to compute a deviance for a
negative variance; lme effectively fits the variances on a log scale
and would probably similarly blow up if you went to the (large) effort
of changing to a linear scale.
It's possible (???) that someone has written method-of-moments
variance estimators in some other R package that would either do what
you want or be modifiable, but I'm not aware of it.
More information about the R-sig-mixed-models
mailing list