public Complex weightedStandardDeviation_as_Complex() {
		boolean hold = Stat.nFactorOptionS;
		if (nFactorReset) {
			if (nFactorOptionI) {
				Stat.nFactorOptionS = true;
			} else {
				Stat.nFactorOptionS = false;
			}
		}
		boolean holdW = Stat.weightingOptionS;
		if (weightingReset) {
			if (weightingOptionI) {
				Stat.weightingOptionS = true;
			} else {
				Stat.weightingOptionS = false;
			}
		}

		Complex varr = Complex.zero();
		if (!weightsSupplied) {
			System.out.println("weightedtandardDeviationS_as_Complex: no weights supplied - unweighted value returned");
			varr = this.standardDeviation_as_Complex();
		} else {
			Complex variance = Complex.zero();
			Complex[] cc = this.getArray_as_Complex();
			Complex[] wc = amWeights.getArray_as_Complex();
			variance = Stat.variance(cc, wc);
			varr = Complex.sqrt(variance);
		}
		Stat.nFactorOptionS = hold;
		Stat.weightingOptionS = holdW;
		return varr;

	}