[Lme4-commits] r1876 - pkg/lme4.0/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Dec 27 21:43:18 CET 2013
Author: walker
Date: 2013-12-27 21:43:17 +0100 (Fri, 27 Dec 2013)
New Revision: 1876
Modified:
pkg/lme4.0/src/lmer.c
Log:
backport prior weights fix in lme4
Modified: pkg/lme4.0/src/lmer.c
===================================================================
--- pkg/lme4.0/src/lmer.c 2013-11-26 00:52:28 UTC (rev 1875)
+++ pkg/lme4.0/src/lmer.c 2013-12-27 20:43:17 UTC (rev 1876)
@@ -809,8 +809,9 @@
d[ldL2_POS] = M_chm_factor_ldetL2(L);
d[pwrss_POS] = d[usqr_POS] + d[wrss_POS];
- d[sigmaML_POS] = sqrt(d[pwrss_POS]/
- (srwt ? sqr_length(srwt, n) : (double) n));
+ //d[sigmaML_POS] = sqrt(d[pwrss_POS]/
+ // (srwt ? sqr_length(srwt, n) : (double) n));
+ d[sigmaML_POS] = sqrt(d[pwrss_POS]/ ((double) n));
d[sigmaREML_POS] = (V || muEta) ? NA_REAL :
d[sigmaML_POS] * sqrt((((double) n)/((double)(n - p))));
return d[pwrss_POS];
@@ -906,8 +907,9 @@
/* store u'u */
d[usqr_POS] = sqr_length((double*)(cu->x), dims[q_POS]);
d[pwrss_POS] = d[usqr_POS] + d[wrss_POS];
- d[sigmaML_POS] = sqrt(d[pwrss_POS]/
- (srwt ? sqr_length(srwt, n) : (double) n));
+ //d[sigmaML_POS] = sqrt(d[pwrss_POS]/
+ // (srwt ? sqr_length(srwt, n) : (double) n));
+ d[sigmaML_POS] = sqrt(d[pwrss_POS]/ ((double) n));
d[sigmaREML_POS] = (V || muEta) ? NA_REAL :
d[sigmaML_POS] * sqrt((((double) n)/((double)(n - p))));
return d[pwrss_POS];
@@ -1041,8 +1043,9 @@
dn * (1 + log(d[pwrss_POS]) + log(2 * PI / dn));
d[REML_POS] = d[ldL2_POS] + d[ldRX2_POS] +
dnmp * (1. + log(d[pwrss_POS]) + log(2. * PI / dnmp));
- d[sigmaML_POS] = sqrt(d[pwrss_POS]/
- (srwt ? sqr_length(srwt, n) : dn));
+ //d[sigmaML_POS] = sqrt(d[pwrss_POS]/
+ // (srwt ? sqr_length(srwt, n) : dn));
+ d[sigmaML_POS] = sqrt(d[pwrss_POS]/ ((double) n));
d[sigmaREML_POS] = d[sigmaML_POS] * sqrt(dn/dnmp);
ans = d[dims[isREML_POS] ? REML_POS : ML_POS];
More information about the Lme4-commits
mailing list