Compute the derivative of the negative log probability with respect to the parameters of one spot, given some samples of the other spots. More...
Public Member Functions | |
SpotNegProbabilityDiffWithSampledBackground (const SampledBackgroundData &d) | |
Vector< 4 > | operator() (const Vector< 4 > &spot) const |
Public Attributes | |
const vector< vector< vector < double > > > & | sample_intensities_without_spot |
const vector< vector< double > > & | pixel_intensities |
const vector< ImageRef > | pixels |
double | mu_brightness |
double | sigma_brightness |
double | mu_blur |
double | sigma_blur |
const Matrix< 3 > | A |
const Vector< 3 > | pi |
double | variance |
const vector< int > | O |
Compute the derivative of the negative log probability with respect to the parameters of one spot, given some samples of the other spots.
Definition at line 565 of file multispot5.cc.
SpotNegProbabilityDiffWithSampledBackground::SpotNegProbabilityDiffWithSampledBackground | ( | const SampledBackgroundData & | d | ) | [inline] |
d | Necessary data for construction |
Definition at line 568 of file multispot5.cc.
00569 :SampledBackgroundData(d) 00570 { 00571 }
Vector<4> SpotNegProbabilityDiffWithSampledBackground::operator() | ( | const Vector< 4 > & | spot | ) | const [inline] |
Compute the probability of spot.
spot | Spot position |
Definition at line 575 of file multispot5.cc.
References SampledBackgroundData::A, SampledMultispot::compute_spot_intensity_derivatives(), diff_log_log_normal(), forward_algorithm_deriv(), SampledBackgroundData::mu_blur, SampledBackgroundData::mu_brightness, SampledBackgroundData::O, SampledBackgroundData::pi, SampledBackgroundData::pixel_intensities, SampledBackgroundData::pixels, SampledBackgroundData::sample_intensities_without_spot, SampledBackgroundData::sigma_blur, SampledBackgroundData::sigma_brightness, and SampledBackgroundData::variance.
00576 { 00577 if(spot[0] <= 0 || spot[1] <= 0) 00578 return Ones * std::numeric_limits<double>::quiet_NaN(); 00579 00580 vector<pair<double, Vector<4> > > spot_intensities = compute_spot_intensity_derivatives(pixels, spot); 00581 00582 Vector<4> sum_diff_log = Zeros; 00583 00584 for(unsigned int s=0; s < sample_intensities_without_spot.size(); s++) 00585 { 00586 SpotWithBackground B(sample_intensities_without_spot[s], spot_intensities, pixel_intensities, variance); 00587 00588 pair<double, Vector<4> > r = forward_algorithm_deriv(A, pi, B, O); 00589 00590 sum_diff_log += r.second; 00591 } 00592 00593 Vector<4> diff_log = sum_diff_log / sample_intensities_without_spot.size(); 00594 00595 //Compute the log probability of the prior 00596 Vector<4> logprior_deriv = makeVector(diff_log_log_normal(spot[0], mu_brightness, sigma_brightness), 00597 diff_log_log_normal(spot[1], mu_blur, sigma_blur), 0, 0); 00598 00599 return -(diff_log + logprior_deriv); 00600 }
const vector<vector<vector<double> > >& SampledBackgroundData::sample_intensities_without_spot [inherited] |
Definition at line 484 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const vector<vector<double> >& SampledBackgroundData::pixel_intensities [inherited] |
Definition at line 485 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const vector<ImageRef> SampledBackgroundData::pixels [inherited] |
Definition at line 486 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::mu_brightness [inherited] |
Definition at line 488 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::sigma_brightness [inherited] |
Definition at line 488 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::mu_blur [inherited] |
Definition at line 488 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::sigma_blur [inherited] |
Definition at line 488 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const Matrix<3> SampledBackgroundData::A [inherited] |
Definition at line 489 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const Vector<3> SampledBackgroundData::pi [inherited] |
Definition at line 490 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::variance [inherited] |
Definition at line 491 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const vector<int> SampledBackgroundData::O [inherited] |
Definition at line 493 of file multispot5.cc.
Referenced by operator()(), sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().