MCPcopy Create free account
hub / github.com/apache/madlib / robuststateToResult

Function robuststateToResult

src/modules/regress/logistic.cpp:1207–1240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1205 */
1206
1207AnyType robuststateToResult(
1208 const Allocator &inAllocator,
1209 const ColumnVector &inCoef,
1210 const ColumnVector &diagonal_of_varianceMat) {
1211
1212 MutableNativeColumnVector variance(
1213 inAllocator.allocateArray<double>(inCoef.size()));
1214
1215 MutableNativeColumnVector coef(
1216 inAllocator.allocateArray<double>(inCoef.size()));
1217
1218 MutableNativeColumnVector stdErr(
1219 inAllocator.allocateArray<double>(inCoef.size()));
1220 MutableNativeColumnVector waldZStats(
1221 inAllocator.allocateArray<double>(inCoef.size()));
1222 MutableNativeColumnVector waldPValues(
1223 inAllocator.allocateArray<double>(inCoef.size()));
1224
1225 for (Index i = 0; i < inCoef.size(); ++i) {
1226 //variance(i) = diagonal_of_varianceMat(i);
1227 coef(i) = inCoef(i);
1228
1229 stdErr(i) = std::sqrt(diagonal_of_varianceMat(i));
1230 waldZStats(i) = inCoef(i) / stdErr(i);
1231 waldPValues(i) = 2. * prob::cdf(
1232 prob::normal(), -std::abs(waldZStats(i)));
1233 }
1234
1235 // Return all coefficients, standard errors, etc. in a tuple
1236 AnyType tuple;
1237 //tuple << variance<<stdErr << waldZStats << waldPValues;
1238 tuple << coef<<stdErr << waldZStats << waldPValues;
1239 return tuple;
1240}
1241
1242/**
1243 * @brief Perform the logistic-regression transition step

Callers 1

runMethod · 0.85

Calls 2

cdfFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected