ThreeB 1.1
Public Member Functions | Public Attributes
SpotNegProbabilityDiffWithSampledBackground Struct Reference

Compute the derivative of the negative log probability with respect to the parameters of one spot, given some samples of the other spots. More...

Inheritance diagram for SpotNegProbabilityDiffWithSampledBackground:
SampledBackgroundData

List of all members.

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

Detailed Description

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 567 of file multispot5.cc.


Constructor & Destructor Documentation

SpotNegProbabilityDiffWithSampledBackground::SpotNegProbabilityDiffWithSampledBackground ( const SampledBackgroundData d) [inline]
Parameters:
dNecessary data for construction

Definition at line 570 of file multispot5.cc.


Member Function Documentation

Vector<4> SpotNegProbabilityDiffWithSampledBackground::operator() ( const Vector< 4 > &  spot) const [inline]

Compute the probability of spot.

Parameters:
spotSpot position

Definition at line 577 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);
    }

Member Data Documentation

const vector<vector<vector<double> > >& SampledBackgroundData::sample_intensities_without_spot [inherited]
const vector<vector<double> >& SampledBackgroundData::pixel_intensities [inherited]
const vector<ImageRef> SampledBackgroundData::pixels [inherited]
double SampledBackgroundData::mu_blur [inherited]
const Matrix<3> SampledBackgroundData::A [inherited]
const Vector<3> SampledBackgroundData::pi [inherited]
double SampledBackgroundData::variance [inherited]
const vector<int> SampledBackgroundData::O [inherited]

The documentation for this struct was generated from the following file: