From: François Blumenfeld on
Hi,

I'm playing around with Mathematica to analyze some electrophysiology
data; this is on my recreation time, so apologies if the following
questions are very basic.

I've imported data (pairs of time points and amplitudes) from pClamp
into Mathematica as lists. The lists are pretty huge (around 150,000
elements per list-I've separated times and amplitudes in two lists).
I've created a histogram of the amplitudes list, letting Mathematica
decide which binning method to use and the width of the bin. Without
user input, it actually did a great job at picking bin width and
binning method; but I don't know how to retrieve that information:
i.e. what bin width was picked and what binning method used for a
particular histogram?

My second question is about fitting a multivariate Gaussian
distribution to a multimodal (usually bimodal) histogram. I've payed
around with NonLinearModelFit, but for some reason I don't think I'm
doing it correctly. My third question is related to this: how do I
retrieve the processed data from the histogram to construct a
frequency table? I'm guessing that this might in fact be the
intermediate step I need to complete before being able to fit a curve
to the histogram data.

Any suggestions welcome!

Francois Blumenfeld-Kouchner

From: Kevin J. McCann on
Francois,

My usual approach to histograms is to first let Mathematica do it, then, once I
have a sense of the data structure, I use BinCounts to pick the bins
that I want and get the counts in them.

As far as the multivariate Gaussian fit to a bimodal distribution. Hmmm.
I am not sure why I would think that that is a good idea. Perhaps a
relevance vector machine approach would provide a better fit.

Kevin

Fran=E7ois Blumenfeld wrote:
> Hi,
>
> I'm playing around with Mathematica to analyze some electrophysiology
> data; this is on my recreation time, so apologies if the following
> questions are very basic.
>
> I've imported data (pairs of time points and amplitudes) from pClamp
> into Mathematica as lists. The lists are pretty huge (around 150,000
> elements per list-I've separated times and amplitudes in two lists).
> I've created a histogram of the amplitudes list, letting Mathematica
> decide which binning method to use and the width of the bin. Without
> user input, it actually did a great job at picking bin width and
> binning method; but I don't know how to retrieve that information:
> i.e. what bin width was picked and what binning method used for a
> particular histogram?
>
> My second question is about fitting a multivariate Gaussian
> distribution to a multimodal (usually bimodal) histogram. I've payed
> around with NonLinearModelFit, but for some reason I don't think I'm
> doing it correctly. My third question is related to this: how do I
> retrieve the processed data from the histogram to construct a
> frequency table? I'm guessing that this might in fact be the
> intermediate step I need to complete before being able to fit a curve
> to the histogram data.
>
> Any suggestions welcome!
>
> Francois Blumenfeld-Kouchner
>

From: Sjoerd C. de Vries on
Hi Fran=E7ois,

You could use something like

Reap[Histogram[RandomReal[NormalDistribution[0, 1], 200],
Automatic, (Sow[{#1, #2}]; #2) &]]

to get at binning and count data. Don't know about binning method, but
you could use one of the named binning methods instead of Automatic
used here if you want to be sure about the method used.

About NonLinearModelFit. If you don't say what you're doing it's hard
to say what you're doing wrong. One thing I can tell you:
NonLinearModelFit should be spelled with lowercase L. Perhaps that's
your problem?

Third question: see first question's answer. Counts are included.

Cheers -- Sjoerd


On Jun 16, 11:38 am, Fran=E7ois Blumenfeld <hypotypo...(a)me.com> wrote:
> Hi,
>
> I'm playing around with Mathematica to analyze some electrophysiology
> data; this is on my recreation time, so apologies if the following
> questions are very basic.
>
> I've imported data (pairs of time points and amplitudes) from pClamp
> into Mathematica as lists. The lists are pretty huge (around 150,000
> elements per list-I've separated times and amplitudes in two lists).
> I've created a histogram of the amplitudes list, letting Mathematica
> decide which binning method to use and the width of the bin. Without
> user input, it actually did a great job at picking bin width and
> binning method; but I don't know how to retrieve that information:
> i.e. what bin width was picked and what binning method used for a
> particular histogram?
>
> My second question is about fitting a multivariate Gaussian
> distribution to a multimodal (usually bimodal) histogram. I've payed
> around with NonLinearModelFit, but for some reason I don't think I'm
> doing it correctly. My third question is related to this: how do I
> retrieve the processed data from the histogram to construct a
> frequency table? I'm guessing that this might in fact be the
> intermediate step I need to complete before being able to fit a curve
> to the histogram data.
>
> Any suggestions welcome!
>
> Francois Blumenfeld-Kouchner