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