ThreeB 1.1
|
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 586 of file multispot5.cc.
SpotNegProbabilityDiffWithSampledBackground::SpotNegProbabilityDiffWithSampledBackground | ( | const SampledBackgroundData & | d | ) | [inline] |
d | Necessary data for construction |
Definition at line 589 of file multispot5.cc.
:SampledBackgroundData(d) { }
Vector<4> SpotNegProbabilityDiffWithSampledBackground::operator() | ( | const Vector< 4 > & | spot | ) | const [inline] |
Compute the probability of spot.
spot | Spot position |
Definition at line 596 of file multispot5.cc.
References SampledMultispot::compute_spot_intensity_derivatives(), diff_log_log_normal(), and forward_algorithm_deriv().
{ if(spot[0] <= 0 || spot[1] <= 0) return Ones * std::numeric_limits<double>::quiet_NaN(); vector<pair<double, Vector<4> > > spot_intensities = compute_spot_intensity_derivatives(pixels, spot); Vector<4> sum_diff_log = Zeros; for(unsigned int s=0; s < sample_intensities_without_spot.size(); s++) { SpotWithBackground B(sample_intensities_without_spot[s], spot_intensities, pixel_intensities, variance); pair<double, Vector<4> > r = forward_algorithm_deriv(A, pi, B, O); sum_diff_log += r.second; } Vector<4> diff_log = sum_diff_log / sample_intensities_without_spot.size(); //Compute the log probability of the prior Vector<4> logprior_deriv = makeVector(diff_log_log_normal(spot[0], mu_brightness, sigma_brightness), diff_log_log_normal(spot[1], mu_blur, sigma_blur), 0, 0); return -(diff_log + logprior_deriv); }
const vector<vector<vector<double> > >& SampledBackgroundData::sample_intensities_without_spot [inherited] |
Definition at line 505 of file multispot5.cc.
Referenced by 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 506 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const vector<ImageRef> SampledBackgroundData::pixels [inherited] |
Definition at line 507 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::mu_brightness [inherited] |
Definition at line 509 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::sigma_brightness [inherited] |
Definition at line 509 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::mu_blur [inherited] |
Definition at line 509 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::sigma_blur [inherited] |
Definition at line 509 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const Matrix<3> SampledBackgroundData::A [inherited] |
Definition at line 510 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const Vector<3> SampledBackgroundData::pi [inherited] |
Definition at line 511 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
double SampledBackgroundData::variance [inherited] |
Definition at line 512 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().
const vector<int> SampledBackgroundData::O [inherited] |
Definition at line 514 of file multispot5.cc.
Referenced by sampled_background_spot_hessian2(), sampled_background_spot_hessian_FAKE(), and sampled_background_spot_hessian_ffbs().