fitted function to array

31 views
Skip to first unread message

Andrew Micallef

unread,
Jul 14, 2013, 9:32:52 AM7/14/13
to sti...@googlegroups.com
Hi,

I've got a lo of voltage traces with EPSPs. I've got the basics of setting the cursors and fitting a function to my raw data. What I'd like to do is to then convert the fitted function into a numpy array (over a set range) which I can use to subtract from other traces. Is there an easy way to access the output of the least_sq() to do this or is it just a matter of defining a dual exponential and inserting the time constant values. If the latter is the case, what is the equation for least_sq(5)?
I don't know what 'factor' refers to in the output or how it produces an EPSP like shape when both time constants are outputted as positive numbers.

Andrew Micallef

unread,
Jul 14, 2013, 9:37:02 AM7/14/13
to sti...@googlegroups.com
Also I am using the latest version of stimfit on windows 7

Christoph Schmidt-Hieber

unread,
Jul 14, 2013, 10:29:54 AM7/14/13
to sti...@googlegroups.com
On Sun, Jul 14, 2013 at 06:32:52AM -0700, Andrew Micallef wrote:
> I've got a lo of voltage traces with EPSPs. I've got the basics of
> setting the cursors and fitting a function to my raw data. What I'd
> like to do is to then convert the fitted function into a numpy array
> (over a set range) which I can use to subtract from other traces.

stf.get_fit() returns the evaluated function as a NumPy array. First
dimension is time, second dimension are the function evaluation
results.

> Is there an easy way to access the output of the least_sq() to do
> this or is it just a matter of defining a dual exponential and
> inserting the time constant values. If the latter is the case, what
> is the equation for least_sq(5)?

The equation is shown here:

http://www.stimfit.org/doc/doxygen/html/group__stfgen.html#ga4dd9d335d263c75d61961db8bb1fe1e2

The corresponding source code is here:

https://code.google.com/p/stimfit/source/browse/src/stimfit/math/funclib.cpp#260

The function is called "stf::fexpbde". We are not performing any
normalization at present; i.e. the amplitude factor p[3] will be
different from the maximum of the function.

Best,
Christoph
Reply all
Reply to author
Forward
0 new messages