protected GLM getGLM(int p, int[][] attrs, boolean[] selected, double[] coef, double intercept, LinkFunction link) {
		GLM glm = new GLM(p);
		int k = 0;
		double[] w = glm.coefficients(0);
		for (int g = 0; g < attrs.length; g++) {
			if (selected[g]) {
				int[] attr = attrs[g];
				for (int attIndex : attr) {
					w[attIndex] = coef[k++];
				}
			}
		}
		glm.intercept[0] = intercept;
		glm.link = link;
		return glm;
	}