Can I use nbinfit given the number of trials, not the number of failures?

1 view (last 30 days)
Short info: I am trying to estimate the parameters for a Pascal distribution, starting from the total number of trials rather then the number of failures. I am unable to measure the individual number of successes or failures, only the total number of trials before enough successes have been achieved. I am trying to model the data as a Pascal distribution to estimate the number of successes and chance of succes.
Sample code:
% histograms are given by number of repetitions, some sample data below
hist1 = [28 44 38 25 22 17 4 8 7];
hist2 = [17 27 34 25 21 20 14 11 10];
%convert to datapoints and plot to get an idea of the data
pts1 = []; for i = 1:9 pts1 = [pts1 i*ones(1, hist1(i))]; end
pts2 = []; for i = 1:9 pts2 = [pts2 i*ones(1, hist2(i))]; end
figure; hist(pts1,9);
figure; hist(pts2,9);
% estimate pascal distribution
[N1 p1] = nbinfit(pts1);
[N2 p2] = nbinfit(pts2);
% This gives values like N = 20, p = .8, while I am expecting N = 3, p=.3
Background: I get signals from brain EEG data, which have a high amount of noise. The signals are recorded from multiple trials, and are averaged before being sent to an SVM classifier. If the classifier score is high enough, we stop the trials. Given the distribution of total number of trials, I am trying to simplify the model by assuming that each individual recording is either successful or not, and trying to derive the probability that individual trials are considered successful from the shape of the histogram.
(edited to add sample code to give something concrete...)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!