2 fitness generators in multirun fitter
2 fitness generators in multirun fitter
I'm fitting parameters of my model to reproduce some dual patch data (hyperpolarization activated channels). gbar_h in my model changes with a sigmoid function (suppose variables of sigmoid functions are gbarHBegin and gbarHEnd. gbar_h of soma = gbarHBegin in my model). I can do this.
now I want to add another limit to multirunfitter. In addition to fit to data, I want amount of gbar_h in a specific dendrite located in 300 mirometer from the soma to be 6 times amount of gbarHBegin.
But how can I do this with multirunfitter?
do I have to add another fitness generator?
if yes which fitness generator is appropriate?
now I want to add another limit to multirunfitter. In addition to fit to data, I want amount of gbar_h in a specific dendrite located in 300 mirometer from the soma to be 6 times amount of gbarHBegin.
But how can I do this with multirunfitter?
do I have to add another fitness generator?
if yes which fitness generator is appropriate?
Re: 2 fitness generators in multirun fitter
is there any chance to do this without modifying the multirun fitter?

 Site Admin
 Posts: 5809
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: 2 fitness generators in multirun fitter
Why not use an FInitializeHandler?where foo is the name of your special section.
Code: Select all
objref fih
fih = new FInitializeHandler("specialstuff()")
proc specialstuff() {
foo gbar_h = 6*gbarHBegin
}
Re: 2 fitness generators in multirun fitter
No. I want to fit the parameters of the model.
this gbar_h = 6*gbarHBegin has some information about the distribution of Ih in the model. it is sth like my electrophysiological data in nature.
Actually the "gbar_h = 6*gbarHBegin" should be sth like this (if calculate_error was a procedure calculates error the way multirunfitter)
then this error should be summed with the error calculated from the electrophysiological part of the data. i.e I want to calculate the error and sum it with fitting error. I don't know if I could explain what I want or not?
there are four different fitness generators in the multirun fitter tool:
1. Run fitness
2. Function fitness
3. Fitness primitives
4. multiple run fitter
at the moment I use "Run fitness" to fit my model to the electrophysiological data. I thought these "Function fitness" or "Fitness primitives" maybe can help me.
I could not find a tutorial for these parts and I don't know what they should do?
this gbar_h = 6*gbarHBegin has some information about the distribution of Ih in the model. it is sth like my electrophysiological data in nature.
Actually the "gbar_h = 6*gbarHBegin" should be sth like this (if calculate_error was a procedure calculates error the way multirunfitter)
Code: Select all
error = calculate_error(gbar_h, 6*gbarHBegin)
there are four different fitness generators in the multirun fitter tool:
1. Run fitness
2. Function fitness
3. Fitness primitives
4. multiple run fitter
at the moment I use "Run fitness" to fit my model to the electrophysiological data. I thought these "Function fitness" or "Fitness primitives" maybe can help me.
I could not find a tutorial for these parts and I don't know what they should do?

 Site Admin
 Posts: 5809
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: 2 fitness generators in multirun fitter
If I didn't understand what you wanted, I still don't. If gbarHBegin is one of the parameters that the MRF is optimizing, and you want gbar_h in a special section to equal 6*gbarHBegin, then what I suggested would ensure that, every time the MRF chose a new value of gbarHBegin and calculated error, gbar_h in the special section would equal 6*gbarHBegin. In other words, the MRF would be optimizing a model that includes your constraint on the value of gbar_h in the special section.
Re: 2 fitness generators in multirun fitter
then let me explain again:If I didn't understand what you wanted, I still don't.
forget about the dendrites. suppose my sigmoid function (gh()) is sth like this:
gh(dist,gbarHBegin,gbarHEnd,Steep) = gbarHBegin + (gbarHEnd  gbarHBegin ) / (1.0 + exp((dHalfdist)/Steep))
gbarHBegin determines the starting value
gbarHEnd gbarHEnd the end value
dHalf is the distance at which gh is the halfway between gbarHBegin and gbarHEnd.
Steep is the steepness of the function.
Value of these parameter are determined by the electrophysiological data using the multirunfitter tool.
I want gh(300,gbarHBegin,gbarHEnd,Steep) becomes sixfold gbarHBegin (after fitting finished).

 Posts: 220
 Joined: Thu Jun 09, 2005 1:09 pm
 Location: Hanze University of Applied Sciences
 Contact:
Re: 2 fitness generators in multirun fitter
Dear Keivan,
I assume you want the value of 6 to emerge from your fitting procedure. From my limited experience with optimization procedures I would think that you would have to combine the two fitness functions into a single fitness function. In this case you would probably have an error function associated with both patch locations, and you like to minimize both. Or alternatively you want to minimize the error function subject to a constraint. Rather than enforcing this constraint by making it explicit you can indeed add the extra "error" function that specifies how much you deviate from the constraint and which reaches its minimum at the constraint. The subject of Lagrange multipliers addresses this question and you might want to look into it.
Raj
I assume you want the value of 6 to emerge from your fitting procedure. From my limited experience with optimization procedures I would think that you would have to combine the two fitness functions into a single fitness function. In this case you would probably have an error function associated with both patch locations, and you like to minimize both. Or alternatively you want to minimize the error function subject to a constraint. Rather than enforcing this constraint by making it explicit you can indeed add the extra "error" function that specifies how much you deviate from the constraint and which reaches its minimum at the constraint. The subject of Lagrange multipliers addresses this question and you might want to look into it.
Raj
Re: 2 fitness generators in multirun fitter
Thank you Raj
Unfortunately I'm not familiar with "Lagrange multiplier". I'm going to learn it.
I didn't think the answer would be complicated when I start the topic.
I thought it needs more programing than mathematics.
That's exactly what I want. What I want is similar to a system of equations.I assume you want the value of 6 to emerge from your fitting procedure.
I don't know how to do this? how to combine a function containing electrophysiological data with some linear algebra equation?you would have to combine the two fitness functions into a single fitness function.
I thought "Function fitness" should do this.you can indeed add the extra "error" function
Unfortunately I'm not familiar with "Lagrange multiplier". I'm going to learn it.
I didn't think the answer would be complicated when I start the topic.
I thought it needs more programing than mathematics.

 Posts: 220
 Joined: Thu Jun 09, 2005 1:09 pm
 Location: Hanze University of Applied Sciences
 Contact:
Re: 2 fitness generators in multirun fitter
Both the error e1(dist,gbarHBegin,gbarHEnd,Steep, ...) between your simulation and electrophysiological data and the "distance" squared e2(dist,gbarHBegin,gbarHEnd,Steep, ...) from your parameters to those satisfying the algebraic relation are functions of your parameters .
Nothing will stop you from adding these into a single function E(dist,gbarHBegin,gbarHEnd,Steep, ...)=\mu_1 * e1(dist,gbarHBegin,gbarHEnd,Steep, ...) + \mu_2 * e2(dist,gbarHBegin,gbarHEnd,Steep, ...).
The factors \mu_1 and \mu_2 (using latex shorthand) weigh the different contributions of your errors. What is more important reaching the factor 6 precisely or getting your fit to the electrophysiological data right? These \mu's are called the Lagrange multipliers; often the first \mu_1 is not specified and simply set to 1.
Unfortunately my experience with the multiplerunfitter is insufficient to help you out with how to implement this.
Nothing will stop you from adding these into a single function E(dist,gbarHBegin,gbarHEnd,Steep, ...)=\mu_1 * e1(dist,gbarHBegin,gbarHEnd,Steep, ...) + \mu_2 * e2(dist,gbarHBegin,gbarHEnd,Steep, ...).
The factors \mu_1 and \mu_2 (using latex shorthand) weigh the different contributions of your errors. What is more important reaching the factor 6 precisely or getting your fit to the electrophysiological data right? These \mu's are called the Lagrange multipliers; often the first \mu_1 is not specified and simply set to 1.
Unfortunately my experience with the multiplerunfitter is insufficient to help you out with how to implement this.

 Site Admin
 Posts: 5809
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: 2 fitness generators in multirun fitter
I think you can handle this without using Lagrange multipliers.
Step back from the detailed problem for a moment, and consider the sigmoid function
f(x) = 1/(1+exp(x/k))
(I'm deliberately using simple notation to encourage a fresh view of the problem).
If one applies the constraint that the function passes through a particular point (x*, y*), i.e. f(x*) = y*, then the value of k is fixed.
Adding an "offset" parameter xh
f(x) = 1/(1+exp((xxh)/k))
allows the constraint f(x*) = y* to be satisfied by adjusting xh or k, but not both. For example, you might allow the optimizer to choose a particular xh, but then the value of k would be found by solving f(x*) = y* for k. Or you might decide to allow the optimizer to choose a particular k, but the value of xh would be found by solving f(x*) = y* for xh.
The most general form of a sigmoid would include a "scale" parameter m and a "bias" parameter b
f(x) = b + m/(1+exp((xxh)/k))
Applying the constraint f(x*) = y* means allowing the optimizer to adjust any three of xh, k, m, or b, but not all four; the value of the fourth parameter would be found by solving f(x*) = y* for it.
Which leads to this suggestion
Set up the MRF so that it automatically adjusts any three of your parameters. Use an FInitializeHandler to calculate what the fourth one should be (by solving f(x*) = y* for the fourth parameter). Then the MRF will do what you want. For example, I'd let the MRF adjust m, xh, and k. Then I'd use the FInitializeHandler to call a procedure that contains this assignment statement:
b = y*  m/(1+exp((x*xh)/k))
Step back from the detailed problem for a moment, and consider the sigmoid function
f(x) = 1/(1+exp(x/k))
(I'm deliberately using simple notation to encourage a fresh view of the problem).
If one applies the constraint that the function passes through a particular point (x*, y*), i.e. f(x*) = y*, then the value of k is fixed.
Adding an "offset" parameter xh
f(x) = 1/(1+exp((xxh)/k))
allows the constraint f(x*) = y* to be satisfied by adjusting xh or k, but not both. For example, you might allow the optimizer to choose a particular xh, but then the value of k would be found by solving f(x*) = y* for k. Or you might decide to allow the optimizer to choose a particular k, but the value of xh would be found by solving f(x*) = y* for xh.
The most general form of a sigmoid would include a "scale" parameter m and a "bias" parameter b
f(x) = b + m/(1+exp((xxh)/k))
Applying the constraint f(x*) = y* means allowing the optimizer to adjust any three of xh, k, m, or b, but not all four; the value of the fourth parameter would be found by solving f(x*) = y* for it.
Which leads to this suggestion
Set up the MRF so that it automatically adjusts any three of your parameters. Use an FInitializeHandler to calculate what the fourth one should be (by solving f(x*) = y* for the fourth parameter). Then the MRF will do what you want. For example, I'd let the MRF adjust m, xh, and k. Then I'd use the FInitializeHandler to call a procedure that contains this assignment statement:
b = y*  m/(1+exp((x*xh)/k))
Re: 2 fitness generators in multirun fitter
Thanks a lot Ted an Raj.
Today I find some time to work on these ideas. Ted's idea was easier to implement and it worked for me.
Thanks a lot again.
Today I find some time to work on these ideas. Ted's idea was easier to implement and it worked for me.
Thanks a lot again.

 Site Admin
 Posts: 5809
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: 2 fitness generators in multirun fitter
Thanks for your patience while we tried to figure out first "what the question was" and then "how to solve it". In general I think the Lagrange multiplier approach would be what most users would want, but there are always special cases.