Automating PRAXIS: computing error and setting domains?
Posted: Wed May 07, 2014 5:11 pm
Hello!
I'm trying to automate fitting certain parameters in a multicompartment neuronal model by minimizing the error between the model's somatic Vm and experimentally recorded Vm from the same protocol. I previously did this manually using the MultipleRunFitter (MRF) but find the process inefficient and error-prone as I have many variations on the model that I need to fit against several experimental traces. I've since attempted automating my fitting procedure using fit_praxis() and have gotten the basic framework in place. However, I have two issues of which I'm not certain how to address thus necessitating a forum post.
1. How is the "Error Value" computed by the MRF Fitness Generator? I thought it might be least squares error between model and experimental output, so I implemented the following in my function that I pass to fit_praxis() to minimize:
The error value reported by err is vastly different than the error displayed by the MRF, by an order of magnitude (greater). Thus, I'm curious how the MRF does it.
2. More importantly, how can I set domain bounds for certain parameters in PRAXIS? In the GUI this can be done by clicking on "Parameters" in the MRF, then selecting "Domain Panel". I need this since some of the parameters are coefficients in the time constant equation for a particular ion channel, and cannot take on certain values (such as zero, or negative values). If I don't set the domain, I will eventually get integration errors in NEURON while running PRAXIS in the GUI, and thus want to avoid this situation when fully automating this procedure. I can't see anywhere in the documentation about how to handle this manually. I've seen that they are defined in the corresponding .ft1 session file in a ParmFitness... End ParmFitness block, but don't know what actually uses this or how to do it in an automated fashion without the MRF.
Thanks in advance for any assistance!
I'm trying to automate fitting certain parameters in a multicompartment neuronal model by minimizing the error between the model's somatic Vm and experimentally recorded Vm from the same protocol. I previously did this manually using the MultipleRunFitter (MRF) but find the process inefficient and error-prone as I have many variations on the model that I need to fit against several experimental traces. I've since attempted automating my fitting procedure using fit_praxis() and have gotten the basic framework in place. However, I have two issues of which I'm not certain how to address thus necessitating a forum post.
1. How is the "Error Value" computed by the MRF Fitness Generator? I thought it might be least squares error between model and experimental output, so I implemented the following in my function that I pass to fit_praxis() to minimize:
Code: Select all
// somav, somat are defined elsewhere
somav = new Vector()
somav.record(&soma[0].v(0.5))
somat = new Vector()
somat.record(&t)
run()
err = 0
for (i=0; i < somat.size(); i=i+1) {
// Need to do this since have CVode active. Iterate over somatic Vm vector of model, and
// find corresponding Vm value of experimental trace by referencing the time vector of the model.
//
// NB: expv is a 13,000 element Vector corresponding to 1.3s of recording.
err = err + (expv.x[somat.x[i]*10-1] - somav.x[i])^2
}
err = sqrt(err) // cause why not
2. More importantly, how can I set domain bounds for certain parameters in PRAXIS? In the GUI this can be done by clicking on "Parameters" in the MRF, then selecting "Domain Panel". I need this since some of the parameters are coefficients in the time constant equation for a particular ion channel, and cannot take on certain values (such as zero, or negative values). If I don't set the domain, I will eventually get integration errors in NEURON while running PRAXIS in the GUI, and thus want to avoid this situation when fully automating this procedure. I can't see anywhere in the documentation about how to handle this manually. I've seen that they are defined in the corresponding .ft1 session file in a ParmFitness... End ParmFitness block, but don't know what actually uses this or how to do it in an automated fashion without the MRF.
Thanks in advance for any assistance!