Analysis 5: Difference between revisions

From Advanced Labs Wiki
Jump to navigation Jump to search
(Created page with ' Back to 2012 Main Page In the past few tutorials, you learned how to fit data using a linear model. While many datasets may be fit with such a model, other datasets, …')
 
No edit summary
Line 1: Line 1:
[[2012 | Back to 2012 Main Page]]
[[2012 | Back to 2012 Main Page]]


In the past few tutorials, you learned how to fit data using a linear model. While many datasets may be fit with such a model, other datasets, including some  that you encounter in the lab course, will not be described by linear models. Remember that a model is linear if it is linear in the parameters. Here we introduce some data that is supposed to represent counts of something
In the past few tutorials, you learned how to fit data using a linear model. While many datasets may be fit with such a model, other datasets, including some  that you encounter in the lab course, will not be described by linear models. Remember that a model is linear if it is linear in the parameters, so a nonlinear model must be nonlinear in the parametes. Here we introduce some data <math>c_i</math> representing, say, the number of gamma-rays incident on a detector. These data are sorted by their energy <math>e_i</math>. We model the counts as a function of their energy:


<math> c_i = A \exp(-(e_i-B)^2/(2 C^2)) + D^x + E </math>


Data for non-linear model and confidence interval example: [[media:counts.txt]]; Code (change sufixx to .py) [[media:Nonlinear_model.txt]]; Output [[media:Data_nonlinear.png]], [[media:Counts_with_fit.png]], [[media:Confidence_peak_constant_background.png]]
Data for non-linear model and confidence interval example: [[media:counts.txt]]; Code (change sufixx to .py) [[media:Nonlinear_model.txt]]; Output [[media:Data_nonlinear.png]], [[media:Counts_with_fit.png]], [[media:Confidence_peak_constant_background.png]]

Revision as of 00:49, 11 February 2012

Back to 2012 Main Page

In the past few tutorials, you learned how to fit data using a linear model. While many datasets may be fit with such a model, other datasets, including some that you encounter in the lab course, will not be described by linear models. Remember that a model is linear if it is linear in the parameters, so a nonlinear model must be nonlinear in the parametes. Here we introduce some data <math>c_i</math> representing, say, the number of gamma-rays incident on a detector. These data are sorted by their energy <math>e_i</math>. We model the counts as a function of their energy:

<math> c_i = A \exp(-(e_i-B)^2/(2 C^2)) + D^x + E </math>

Data for non-linear model and confidence interval example: media:counts.txt; Code (change sufixx to .py) media:Nonlinear_model.txt; Output media:Data_nonlinear.png, media:Counts_with_fit.png, media:Confidence_peak_constant_background.png