template<class DstArrayT, class SrcArrayT>
Produce the result value.
Definition at line 227 of file IntWeibullNgbPnLoop.h. References Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mData, Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mEcdf, Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mFrac, Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mGamma, Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mSumDataPowerGamma, Impala::Core::Array::MulVal(), Impala::Core::Feature::IntWeibullNgbPnLoop< DstArrayT, SrcArrayT >::mVerbose, Impala::Core::Array::Set(), and Impala::Core::Table::Sort(). 00228 { 00229 double Beta = pow(mSumDataPowerGamma/mFrac, (1/mGamma)); 00230 if(Beta == 0) 00231 Beta = 0.000001; 00232 Core::Array::Sort(mEcdf, mData); 00233 Core::Array::Set(mData, mEcdf); 00234 Core::Array::MulVal(mEcdf, mEcdf, 1/mData->Value(mFrac-1, 0)); 00235 double AD = 0.0; 00236 double F; 00237 double dF; 00238 for (int i=0; i<mFrac; i++) 00239 { 00240 F = 1 - exp(-(1/mGamma)*pow(mData->Value(i, 0)/Beta, mGamma)); 00241 00242 if(F !=0 && F != 1) 00243 { 00244 dF = (1/Beta)*pow( mData->Value(i, 0)/Beta, mGamma-1 )*F; 00245 AD += pow((mEcdf->Value(i, 0) - F), 2)*dF/(F*(1-F)); 00246 } 00247 } 00248 AD = AD/mFrac; 00249 if (mVerbose) 00250 std::cout << "result: Gamma = " << mGamma << " Beta = " << Beta << " AD = " << AD << std::endl; 00251 return Core::Array::Element::Vec3Real64(Beta, mGamma, AD); 00252 }
Here is the call graph for this function:
|