Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 7 to 7 | ||||||||
This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are four related parts all designed to introduce you to Monte Carlo techniques, essential tools in the analysis of data in all modern scientific endeavors, build familiarity with the three basic statistical distributions important in data analysis, and to further your computing skills.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 18 to 18 | ||||||||
Suggested Reading for this lab:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methods | ||||||||
Line: 33 to 33 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Part B. Calculate the Volume of an N-dimensional spheres | |||||||
> > | Part B. Calculate the Volume of N-dimensional spheres | |||||||
Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | ||||||||
Changed: | ||||||||
< < | Part C: Generate Poisson deviates, histogram and plot the distribution | |||||||
> > | Part C: Generate Poisson deviates, histogram, and plot the distribution | |||||||
In Part C the assignment is to generate a sample of Poisson deviates using Monte Carlo methods, specifically the transformation method. The method depends on the conservation of probabilities which stipulates that a draw from a uniform random distribution is equivalent to a draw from any other distribution, including the Poisson. Symbolically, | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
where is the uniform distribution defined on the interval and is, in this case, the Poisson distribution function, a discrete distribution, | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
with x an integer and mean μ. | ||||||||
Line: 53 to 53 | ||||||||
| ||||||||
Changed: | ||||||||
< < | The prescription above is a computational evaluation of the above equation to determine the variable x which is the Poisson deviate. | |||||||
> > | The prescription above is a computational evaluation of the above equation to determine the variable x which is the Poisson deviates. | |||||||
Repeat this process N = 10,000 times to obtain 10,000 Poisson deviates. | ||||||||
Changed: | ||||||||
< < | You will need as an input parameter the mean of the distribution. You will then histogram the deviates and plot the histograms, include these in your report. Remember that histogram binning is important. If you don't get this right the plots will look funny, either there will be spaces between bins of some bins will be much larger than their neighbors, indicating overflow. Given that you are plotting Poisson distributions that are discrete the bin width is = 1.Please repeat the generation of Poisson deviates 3 times: one with | |||||||
> > | You will need as an input parameter the mean of the distribution. You will then histogram the deviates and plot the histograms, include these in your report. Remember that histogram binning is important. If you don't get this right the plots will look funny, either there will be spaces between bins of some bins will be much larger than their neighbors, indicating overflow. Given that you are plotting Poisson distributions that are discrete the bin width is = 1. Please repeat the generation of Poisson deviates 3 times: one with μ = 1.0, μ = 10.3 and μ = 102.1. | |||||||
Part D. Generate and Fit a GaussianIn this exercise, you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors, and discuss the goodness of the fit via the reduced chi2. | ||||||||
Changed: | ||||||||
< < | There are many ways to generate a normally distributed set of data. One way is to start off with a uniform (flat) distribution of data points, generated between 0 to 1, and transform them to a normally distributed set of data via the Box-Muller 2D Gaussian transformation described in Bevington and Robinson or here<a href:http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf > http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf </a> This clever algorithm is both efficient and easy to implement. There are many sources you can read about it, there is even a Wikipedia article on it. There is an easier way but one I do not want you to use. It turns out that given the usefulness of having random numbers drawn from a Gaussian are, every programming language has normal or Gaussian deviate generators in standard libraries. For example, numerical Python has a built-in normal random number generator in NumPy and probably all other math libraries. Again please do not use a built-in method or any functions that invoke a normal random number generator. The assignment calls for you "coding up" the Box-Muller procedure yourself. | |||||||
> > | There are many ways to generate a normally distributed set of data. One way is to start off with a uniform (flat) distribution of data points, generated between 0 to 1, and transform them to a normally distributed set of data via the Box-Muller 2D Gaussian transformation described in Bevington and Robinson or here<a href:http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf > http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf </a> This clever algorithm is both efficient and easy to implement. There are many sources you can read about it, there is even a Wikipedia article on it. There is an easier way but one I do not want you to use. It turns out that given the usefulness of having random numbers drawn from a Gaussian area, every programming language has normal or Gaussian deviate generators in standard libraries. For example, numerical Python has a built-in normal random number generator in NumPy and probably all other math libraries. Again please do not use a built-in method or any functions that invoke a normal random number generator. The assignment calls for you "coding up" the Box-Muller procedure yourself. | |||||||
Here is how to do it:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 6 to 6 | ||||||||
This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are four related parts all designed to introduce you to Monte Carlo techniques, essential tools in the analysis of data in all modern scientific endeavors, build familiarity with the three basic statistical distributions important in data analysis, and to further your computing skills. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and upload it as your first program assignment on Canvas. | |||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and upload it as your first program assignment on Canvas. | |||||||
Changed: | ||||||||
< < | Suggested Reading for this lab:
| |||||||
> > | Suggested Reading for this lab:
| |||||||
| ||||||||
Line: 35 to 35 | ||||||||
Part B. Calculate the Volume of an N-dimensional spheres | ||||||||
Changed: | ||||||||
< < | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | |||||||
> > | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | |||||||
Part C: Generate Poisson deviates, histogram and plot the distributionIn Part C the assignment is to generate a sample of Poisson deviates using Monte Carlo methods, specifically the transformation method. The method depends on the conservation of probabilities which stipulates that a draw from a uniform random distribution is equivalent to a draw from any other distribution, including the Poisson. Symbolically, | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
where is the uniform distribution defined on the interval and is, in this case, the Poisson distribution function, a discrete distribution, | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Changed: | ||||||||
< < | with x an integer and mean μ. | |||||||
> > | with x an integer and mean μ. | |||||||
Here is how to do it:
| ||||||||
Line: 60 to 60 | ||||||||
You will need as an input parameter the mean of the distribution. You will then histogram the deviates and plot the histograms, include these in your report. Remember that histogram binning is important. If you don't get this right the plots will look funny, either there will be spaces between bins of some bins will be much larger than their neighbors, indicating overflow. Given that you are plotting Poisson distributions that are discrete the bin width is = 1.Please repeat the generation of Poisson deviates 3 times: one with
Part D. Generate and Fit a Gaussian | ||||||||
Changed: | ||||||||
< < | In this exercise, you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors, and discuss the goodness of the fit via the reduced chi2. | |||||||
> > | In this exercise, you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors, and discuss the goodness of the fit via the reduced chi2. | |||||||
Changed: | ||||||||
< < | There are many ways to generate a normally distributed set of data. One way is to start off with a uniform (flat) distribution of data points, generated between 0 to 1, and transform them to a normally distributed set of data via the Box-Muller 2D Gaussian transformation described in Bevington and Robinson or here<a href:http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf > http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf </a> This clever algorithm is both efficient and easy to implement. There are many sources you can read about it, there is even a Wikipedia article on it. There is an easier way but one I do not want you to use. It turns out that given the usefulness of having random numbers drawn from a Gaussian are, every programming language has normal or Gaussian deviate generators in standard libraries. For example, numerical Python has a built-in normal random number generator in NumPy and probably all other math libraries. Again please do not use a built-in method or any functions that invoke a normal random number generator. The assignment calls for you "coding up" the Box-Muller procedure yourself. | |||||||
> > | There are many ways to generate a normally distributed set of data. One way is to start off with a uniform (flat) distribution of data points, generated between 0 to 1, and transform them to a normally distributed set of data via the Box-Muller 2D Gaussian transformation described in Bevington and Robinson or here<a href:http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf > http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf </a> This clever algorithm is both efficient and easy to implement. There are many sources you can read about it, there is even a Wikipedia article on it. There is an easier way but one I do not want you to use. It turns out that given the usefulness of having random numbers drawn from a Gaussian are, every programming language has normal or Gaussian deviate generators in standard libraries. For example, numerical Python has a built-in normal random number generator in NumPy and probably all other math libraries. Again please do not use a built-in method or any functions that invoke a normal random number generator. The assignment calls for you "coding up" the Box-Muller procedure yourself. | |||||||
Here is how to do it:
| ||||||||
Line: 70 to 70 | ||||||||
| ||||||||
Changed: | ||||||||
< < | GradingRubric | |||||||
> > | GradingRubric |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 6 to 6 | ||||||||
This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are four related parts all designed to introduce you to Monte Carlo techniques, essential tools in the analysis of data in all modern scientific endeavors, build familiarity with the three basic statistical distributions important in data analysis, and to further your computing skills. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 35 to 36 | ||||||||
Part B. Calculate the Volume of an N-dimensional spheresModify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | ||||||||
Added: | ||||||||
> > | Part C: Generate Poisson deviates, histogram and plot the distributionIn Part C the assignment is to generate a sample of Poisson deviates using Monte Carlo methods, specifically the transformation method. The method depends on the conservation of probabilities which stipulates that a draw from a uniform random distribution is equivalent to a draw from any other distribution, including the Poisson. Symbolically, where is the uniform distribution defined on the interval and is, in this case, the Poisson distribution function, a discrete distribution, with x an integer and mean μ. Here is how to do it:
| |||||||
Part D. Generate and Fit a GaussianIn this exercise, you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors, and discuss the goodness of the fit via the reduced chi2. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Added: | ||||||||
> > | ||||||||
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are three related parts:
| |||||||
> > | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are four related parts all designed to introduce you to Monte Carlo techniques, essential tools in the analysis of data in all modern scientific endeavors, build familiarity with the three basic statistical distributions important in data analysis, and to further your computing skills.
| |||||||
Added: | ||||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and upload it as your first program assignment on Canvas. | |||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and email me your code as part of your grade.
Suggested Reading for this lab:
| |||||||
> > | Suggested Reading for this lab:
| |||||||
| ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Part A. Calculate the value of π (pi) using Monte Carlo methods | ||||||||
Changed: | ||||||||
< < | In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo method to calculate the value of π and its uncertainty. Make sure that the number of iterations will be sufficient to provide an accuracy of π to 0.1%. You will need to use the appropriate number of iteractions to achive this precision. | |||||||
> > | In this exercise, you will write a program that will be the basis of the rest of the lab. In it, you will use the acceptance/rejection Monte Carlo method to calculate the value of π and its uncertainty. The number of iterations should be sufficient to provide an accuracy (relative error dpi/pi) of π o at least 0.1%. You will need to use the appropriate number of interactions to achieve this precision. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5)Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values.Part C. Generate and Fit a GaussianIn this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2. There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. DO not use the method that invokes the built in normal random generaor. Follow the prescription below. Here is how:
GradingRubric | |||||||
> > |
Part B. Calculate the Volume of an N-dimensional spheresModify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values.Part D. Generate and Fit a GaussianIn this exercise, you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors, and discuss the goodness of the fit via the reduced chi2. There are many ways to generate a normally distributed set of data. One way is to start off with a uniform (flat) distribution of data points, generated between 0 to 1, and transform them to a normally distributed set of data via the Box-Muller 2D Gaussian transformation described in Bevington and Robinson or here<a href:http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf > http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf </a> This clever algorithm is both efficient and easy to implement. There are many sources you can read about it, there is even a Wikipedia article on it. There is an easier way but one I do not want you to use. It turns out that given the usefulness of having random numbers drawn from a Gaussian are, every programming language has normal or Gaussian deviate generators in standard libraries. For example, numerical Python has a built-in normal random number generator in NumPy and probably all other math libraries. Again please do not use a built-in method or any functions that invoke a normal random number generator. The assignment calls for you "coding up" the Box-Muller procedure yourself. Here is how to do it:
GradingRubric |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 32 to 32 | ||||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) | ||||||||
Changed: | ||||||||
< < | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | |||||||
> > | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | |||||||
Part C. Generate and Fit a GaussianIn this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2. | ||||||||
Changed: | ||||||||
< < | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. DO not use the method that invokes the built in normal random generaor. Follow the prescription below. | |||||||
> > | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. DO not use the method that invokes the built in normal random generaor. Follow the prescription below. | |||||||
Here is how:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo TechniquesThis lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are three related parts: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 22 to 22 | ||||||||
In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo method to calculate the value of π and its uncertainty. Make sure that the number of iterations will be sufficient to provide an accuracy of π to 0.1%. You will need to use the appropriate number of iteractions to achive this precision.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are three related parts: 1. you will make use the Monte Carlo acceptance/rejection method to compute the value of &pi and its statistical uncertainty. You may use any programming language you want as long as its one of these four: C, C++, python or FORTRAN. 2. next you will use the same MC method to compute the volume of an n-dimensional sphere. 3. In the final part of the lab you will use the random number generator to first create normally distributed data points which are then histogramed and fit with a Gaussian probability distribution function. | |||||||
> > | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are three related parts:
| |||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and email me your code as part of your grade. | |||||||
> > | ||||||||
Changed: | ||||||||
< < | Suggested Reading for this lab: | |||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and email me your code as part of your grade. | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | Suggested Reading for this lab:
| |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methods | ||||||||
Changed: | ||||||||
< < | In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo Method to calculate the value of π and its uncertainty. The number of iterations will be sufficient to provide an accuracy of pi to 0.1%. This will be the main result of this section. | |||||||
> > | In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo method to calculate the value of π and its uncertainty. Make sure that the number of iterations will be sufficient to provide an accuracy of π to 0.1%. You will need to use the appropriate number of iteractions to achive this precision. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) | ||||||||
Changed: | ||||||||
< < | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties and finaly compare your results with analytic values that you can compute yourself or quote them from a reference. | |||||||
> > | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties. You should also compare compare your results with analytic values that you can compute by some other means. Please include the means used to compute the analytic values. | |||||||
Part C. Generate and Fit a Gaussian | ||||||||
Changed: | ||||||||
< < | In this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2. | |||||||
> > | In this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2. | |||||||
Changed: | ||||||||
< < | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. I would prefer you use the easier to understand method using a uniform distribution and then transform to normal distribution in this lab. | |||||||
> > | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. DO not use the method that invokes the built in normal random generaor. Follow the prescription below. | |||||||
Changed: | ||||||||
< < | Here is how to proceed:
| |||||||
> > | Here is how:
| |||||||
| ||||||||
Changed: | ||||||||
< < | GradingRubric | |||||||
> > | GradingRubric |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 17 to 17 | ||||||||
In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo Method to calculate the value of π and its uncertainty. The number of iterations will be sufficient to provide an accuracy of pi to 0.1%. This will be the main result of this section. | ||||||||
Deleted: | ||||||||
< < | ||||||||
| ||||||||
Line: 34 to 33 | ||||||||
In this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2. | ||||||||
Changed: | ||||||||
< < | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the Fox-Muller transform, described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. This method is probably the easiest to understand but not the simplest to implement. That would be to use the builtin normal random number generators available from libraries that come with your programming environment. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. I would prefer you use the easier to understand method using rand() but the you can use the simpler ones too. | |||||||
> > | There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the gaussian transform described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. The "gaussian" transformed defined in the PDG document is known as the Box-Muller transform, in case you want to research turning uniform distributions into other distributions). This method is probably the easiest to understand and pretty strainght forward to implement in your code. An easier way would be to just use builtin normal random number generators available from standard libraries. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. I would prefer you use the easier to understand method using a uniform distribution and then transform to normal distribution in this lab. | |||||||
Changed: | ||||||||
< < | Here is how to proceed: | |||||||
> > | Here is how to proceed: | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac or you can use our Linux server medianoche.hep.fiu.edu on which an account was created for you during class. Part of the assignment is to interact with the Linux server to gain some basic rudimentary familiarity with the Linux environment given that this will likely be something you will encounter after you leave FIU and join a research group. In this lab there are three related parts: 1. you will make use the Monte Carlo acceptance/rejection method to compute the value of &pi and its statistical uncertainty. You may use any programming language you want as long as its one of these four: C, C++, python or FORTRAN. In the account setup for you on medianoche a starter program has been deposited to your home area in your account. You can start with this code and modify it to output the relevant quantities. 2. next you will use the same MC method to compute the volume of an n-dimensional sphere. 3. In the final part of the lab you will use the random number generator to first create normally distributed data points which are then histogramed and fit with a Gaussian probability distribution function. | |||||||
> > | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac. In this lab there are three related parts: 1. you will make use the Monte Carlo acceptance/rejection method to compute the value of &pi and its statistical uncertainty. You may use any programming language you want as long as its one of these four: C, C++, python or FORTRAN. 2. next you will use the same MC method to compute the volume of an n-dimensional sphere. 3. In the final part of the lab you will use the random number generator to first create normally distributed data points which are then histogramed and fit with a Gaussian probability distribution function. | |||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. | |||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and email me your code as part of your grade. | |||||||
Suggested Reading for this lab: | ||||||||
Line: 17 to 17 | ||||||||
In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo Method to calculate the value of π and its uncertainty. The number of iterations will be sufficient to provide an accuracy of pi to 0.1%. This will be the main result of this section. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo TechniquesThis lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac or you can use our Linux server medianoche.hep.fiu.edu on which an account was created for you during class. Part of the assignment is to interact with the Linux server to gain some basic rudimentary familiarity with the Linux environment given that this will likely be something you will encounter after you leave FIU and join a research group. In this lab there are three related parts: 1. you will make use the Monte Carlo acceptance/rejection method to compute the value of &pi and its statistical uncertainty. You may use any programming language you want as long as its one of these four: C, C++, python or FORTRAN. In the account setup for you on medianoche a starter program has been deposited to your home area in your account. You can start with this code and modify it to output the relevant quantities. 2. next you will use the same MC method to compute the volume of an n-dimensional sphere. 3. In the final part of the lab you will use the random number generator to first create normally distributed data points which are then histogramed and fit with a Gaussian probability distribution function. | ||||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade.
Suggested Reading for this lab: | |||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. Suggested Reading for this lab: | |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methods | ||||||||
Deleted: | ||||||||
< < | ALSO: Include in your report the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | In this excercise you will write a program that will be the basis of the rest of the labs. In it you will use the acceptance/rejection Monte Carlo Method to calculate the value of π and its uncertainty. The number of iterations will be sufficient to provide an accuracy of pi to 0.1%. This will be the main result of this section. | |||||||
Added: | ||||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5)Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties and finaly compare your results with analytic values that you can compute yourself or quote them from a reference.Part C. Generate and Fit a Gaussian | ||||||||
Deleted: | ||||||||
< < | Using Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | |||||||
Changed: | ||||||||
< < |
GradingRubric | |||||||
> > | In this exercise you employ the Monte Carlo technique to generate data distributed as a normal or Gaussian distribution. Then you will fit the generated data sample to a Gaussian Probability Distribution Function (PDF), determine the fit parameters and their errors and discuss the goodness of the fit via the reduced chi2.
There are many ways to generate a normally distributed set of data. One way is start off with a uniform (flat) distribution of data points, generated between 0 to 1 and transform them to a normally distributed set of data via the Fox-Muller transform, described here http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf. This method is probably the easiest to understand but not the simplest to implement. That would be to use the builtin normal random number generators available from libraries that come with your programming environment. For example numerical python has builtin normal random number generator and so does root. I am not sure if the stnd libraries in C/C++ do but I am sure they exist. I would prefer you use the easier to understand method using rand() but the you can use the simpler ones too.
Here is how to proceed:
GradingRubric | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be accomplished mostly on a computer; preferably on the server medianoche on which you were given an account on the first day of class. In fact, part of the lab is to gain some familiarity with the use of Linux servers, something you will likely encounter very soon after you leave FIU. There are three related parts to the lab. First, you will write a program to compute the value of &pi using a random number generator and the acceptance/rejection Monte Carlo method. You can use any programming language you want: C, C++, python or even FORTRAN. Sample code is installed for you in your account. You then modify your code or write another program to compute the volume of an n-dimensional sphere using the same MC technique. The last part of the lab you'll use your newly acquired computing skills to generate a set of data distributed as a Gaussian using a transform to convert your flat random distribution to a Gaussian one, fitting the later with a Gaussian. | |||||||
> > | This lab is to be completed mostly on a computer. You can use the python tools you installed on your PC or Mac or you can use our Linux server medianoche.hep.fiu.edu on which an account was created for you during class. Part of the assignment is to interact with the Linux server to gain some basic rudimentary familiarity with the Linux environment given that this will likely be something you will encounter after you leave FIU and join a research group. In this lab there are three related parts: 1. you will make use the Monte Carlo acceptance/rejection method to compute the value of &pi and its statistical uncertainty. You may use any programming language you want as long as its one of these four: C, C++, python or FORTRAN. In the account setup for you on medianoche a starter program has been deposited to your home area in your account. You can start with this code and modify it to output the relevant quantities. 2. next you will use the same MC method to compute the volume of an n-dimensional sphere. 3. In the final part of the lab you will use the random number generator to first create normally distributed data points which are then histogramed and fit with a Gaussian probability distribution function. | |||||||
Changed: | ||||||||
< < | Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. | |||||||
> > | Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. | |||||||
Suggested Reading for this lab:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 6 to 6 | ||||||||
This lab is to be accomplished mostly on a computer; preferably on the server medianoche on which you were given an account on the first day of class. In fact, part of the lab is to gain some familiarity with the use of Linux servers, something you will likely encounter very soon after you leave FIU. There are three related parts to the lab. First, you will write a program to compute the value of &pi using a random number generator and the acceptance/rejection Monte Carlo method. You can use any programming language you want: C, C++, python or even FORTRAN. Sample code is installed for you in your account. You then modify your code or write another program to compute the volume of an n-dimensional sphere using the same MC technique. The last part of the lab you'll use your newly acquired computing skills to generate a set of data distributed as a Gaussian using a transform to convert your flat random distribution to a Gaussian one, fitting the later with a Gaussian. Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. | ||||||||
Added: | ||||||||
> > | Suggested Reading for this lab:
| |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methodsALSO: Include in your report the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be accomplished mostly on a computer. Preferably on the server medianoche on which you were given an account on the first day. Part of the lab is to gain some familiarity with the use of Linux server, something you might encounter very soon after you leave FIU. There are three related parts to the lab. First, you will write a program to compute the value of pi using a random number generator and the acceptance/rejection Montecarlo method. You can use any programing language you want: C, C++, python or even FORTRAN. Sample code is installed for you in your account. You then modify youcode or write another program to compute the volume of an n-dimensional sphere using the same MC technique. The last part of the lab you'll use your newly aquired computing skills to generate a set of data distributed as a Gaussian using a transform to convert your flat random distribution to a Gaussian one, fitting the later with a Gaussian. | |||||||
> > | This lab is to be accomplished mostly on a computer; preferably on the server medianoche on which you were given an account on the first day of class. In fact, part of the lab is to gain some familiarity with the use of Linux servers, something you will likely encounter very soon after you leave FIU. There are three related parts to the lab. First, you will write a program to compute the value of &pi using a random number generator and the acceptance/rejection Monte Carlo method. You can use any programming language you want: C, C++, python or even FORTRAN. Sample code is installed for you in your account. You then modify your code or write another program to compute the volume of an n-dimensional sphere using the same MC technique. The last part of the lab you'll use your newly acquired computing skills to generate a set of data distributed as a Gaussian using a transform to convert your flat random distribution to a Gaussian one, fitting the later with a Gaussian. | |||||||
Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade.
Part A. Calculate the value of π (pi) using Monte Carlo methodsALSO: Include in your report the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) | ||||||||
Line: 27 to 27 | ||||||||
Part C. Generate and Fit a GaussianUsing Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
MN_CMD>plot 10&0 | ||||||||
Changed: | ||||||||
< < | MN_CMD>fun add gaussian These commands will first list all histograms read into mnfit then plot higtogram 10&0 (the &0 indicates a secondary identifier) and add a Gaussian function as the probability distribution function to be used in a fit to your data. The fun add Gaussian will expect arguments, use sigma type, and enter reasonable values for the parameters when prompted. By reasonable I mean values close to what you see for your plot. Now do the following: MN_CMD> fit 1 | |||||||
> > | MN_CMD>fun add gaussian These commands will first list all histograms read into mnfit then plot histogram 10&0 (the &0 indicates a secondary identifier) and add a Gaussian function as the probability distribution function to be used in a fit to your data. The fun add Gaussian will expect arguments, use sigma type, and enter reasonable values for the parameters when prompted. By reasonable I mean values close to what you see for your plot. Now do the following: MN_CMD> fit 1 | |||||||
MINUIT> minimize MINUIT> display | ||||||||
Changed: | ||||||||
< < | MINUIT> minos The fit 1 command will fit the histogram number 1 with the function loaded into the fitter. You will have to select what type of fit to use. You can use the chi2 fit for this exercise. The "minimize" command will put you into the minimization and error analysis package called MINUIT. MINUIT is a set of functions algorithms and a complete package from CERN. Its been around for a very long time so has lots of features and is used by many people not only in high energy/nuclear physics. It may be of interest to you to spend some time exploring the documentation from CERN. The "display" command will displays your histogram with the fitted function (the function with the best parameters obtained by the fitting procedure overlayed on the plot complete with statistical errors. The numbers are also displayed in tabular form below. The command "minos" will recalculate the errors using a more sophisticated approach where the minimizer doesn't assume that your errors are parabolic. For more information check the CERN documentation | |||||||
> > | MINUIT> minos The fit 1 command will fit the histogram number 1 with the function loaded into the fitter. You will have to select what type of fit to use. You can use the chi2 fit for this exercise. The "minimize" command will put you into the minimization and error analysis package called MINUIT. MINUIT is a set of functions algorithms and a complete package from CERN. Its been around for a very long time so has lots of features and is used by many people not only in high energy/nuclear physics. It may be of interest to you to spend some time exploring the documentation from CERN. The "display" command will displays your histogram with the fitted function (the function with the best parameters obtained by the fitting procedure overlay on the plot complete with statistical errors. The numbers are also displayed in tabular form below. The command "minos" will recalculate the errors using a more sophisticated approach where the minimizer doesn't assume that your errors are parabolic. For more information check the CERN documentation | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This lab is to be accomplished mostly on a computer. There are three related parts to the lab. First, you will write a program to compute the value of pi using a random number generator and the acceptance/rejection Montecarlo method. You then use use the technique to compute the volume of an n-dimensional sphere and finally use your newly aquired computing skills to generate a set of data distributed as a Gaussian whihc you will fit a Gaussian functional form. This work will all be detailed in a report you'll write in the format of a modern physics journal. Please note that while you will work closely with your lab partner you are expected to write your own code and present to me as part of your grade. I strongly recommend that you do your programming work on the medianocher server that will be made available to you during the course. While it may be easier to do everything on your own PC or Mac it is likely that you will need to work on a linux server in yor should turn your own work. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Also don't forget to cite all references properly. | |||||||
> > | This lab is to be accomplished mostly on a computer. Preferably on the server medianoche on which you were given an account on the first day. Part of the lab is to gain some familiarity with the use of Linux server, something you might encounter very soon after you leave FIU. There are three related parts to the lab. First, you will write a program to compute the value of pi using a random number generator and the acceptance/rejection Montecarlo method. You can use any programing language you want: C, C++, python or even FORTRAN. Sample code is installed for you in your account. You then modify youcode or write another program to compute the volume of an n-dimensional sphere using the same MC technique. The last part of the lab you'll use your newly aquired computing skills to generate a set of data distributed as a Gaussian using a transform to convert your flat random distribution to a Gaussian one, fitting the later with a Gaussian. Please note that while you will work closely with your lab partner you are expected to write your own code and present to me on the server as part of your grade. | |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methods | ||||||||
Changed: | ||||||||
< < | Assignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | |||||||
> > | ALSO: Include in your report the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | |||||||
| ||||||||
Line: 20 to 22 | ||||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) | ||||||||
Deleted: | ||||||||
< < | Assignment: Use Monte Carlo Methods to determine the volume of an N-dimensional sphere of unit radius when N=1,2,3,4 and 5. | |||||||
Changed: | ||||||||
< < | Modify your program and quote the volumns with errors for 10,000 tries. Also compare your results with the analytic values. You can compute these yourself or quote them from a reference.
C. Generate and Fit a GaussianAssignment: Using Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | |||||||
> > | Modify your program, or write a new one, to determine the volumes of N-dimensional spheres (N=1,2,3,4,5 but you've already done the 2D one) with radius=1.0. Use 10,000 tries and make sure you quote your uncertainties and finaly compare your results with analytic values that you can compute yourself or quote them from a reference.
Part C. Generate and Fit a GaussianUsing Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 7 to 7 | ||||||||
Part A. Calculate the value of π (pi) using Monte Carlo methodsAssignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 15 to 15 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) | ||||||||
Changed: | ||||||||
< < | Assignment: Use Monte Carlo Methods to determine the volume of N-dimensional sphere of unit radius from N=1 to N=5. | |||||||
> > | Assignment: Use Monte Carlo Methods to determine the volume of an N-dimensional sphere of unit radius when N=1,2,3,4 and 5. | |||||||
Changed: | ||||||||
< < | For this lab use 10,000 tries to determine the central value f the volume. In your results quote that and the associated statistical error. Also compare your result with theoretical value determined analytically. | |||||||
> > | Modify your program and quote the volumns with errors for 10,000 tries. Also compare your results with the analytic values. You can compute these yourself or quote them from a reference. | |||||||
C. Generate and Fit a GaussianAssignment: Using Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | ||||||||
Changed: | ||||||||
< < | In this exercise you employ the Monte Carlo technique to generate a normal distribution which you will subsequently fit to a Gaussian Probability Distribution Function (PDF). This is another common use of the Monte Carlo method, especially in particle and nuclear physics. The Monte Carlo approach can be used to generate any kind of distribution useful when simulating a variety of phenomena. In this lab you will first create a data set process it and then use a fitting package, (an application with an interface to fitting algorithms). In an real experiments, particularly when the physical processes are difficult to extract or the data analysis is particularly sophisticated, the ability to simulate the reaction of the experiment to simulated data is a critical part of the data analysis procedure. There are essentially two parts to this lab. First you will use the same random number technique you used in parts A and B plus a suitable algorithm to create a Gaussian histogram. To generate your data distribution you will once again use a random number generator over interval 0 to 1. The uniformly distributed output will be applied in an algorithm to create the Gaussian distributed data. There are many different algorithms available to do this and a variety of sources exist to aid you, for example: there are a couple of ways described in the Particle Data Group Math Review section (http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf). Alternatives that are faster more or less accurate exists and you are encouraged to explore these on your own. Once you've coded the MC algorithm you will need to histogram the output, remember we are ultimately going to fit the histogram to a Gaussian PDF as part of this exercise. The histogramming process can be done in the code itself or you can feed the raw output data to histogramming package. In Particle/Nuclear physics we use a set of libraries called ROOT to histogram things. There are some older packages, ie HBOOK (fortran based) that do the same thing. Other packages and applications probably exists as well. In fact, you are probably most familiar with Microsoft's excel program; it has a histogramming feature built into the data analysis package. The easiest thing to do is to create your histogram directly in your MC program. Once you have your histogram you will need to fit the simulated data with whatever fitting package you choose. Dr. Boeglin's Modern Physics class provided you with a new python based fitting package that will be more than suitable for this exercise. Also, I have dusted up a particularly simple but powerful package, called MINFIT, that I used in graduate school a few years ago. This package or application is available to you on the HEP analysis cluster (medianoche.hep.fiu.edu). To invoke it type its name "mn_fit" on the command line. There are instructions below on how to use it and an online manual is available. Alternatively you can use the fitting packages in MATLAB, or Matehmatica if you so desired. I believe even MS excel can be coxed to do curve fitting, at least a simple Gaussian fit as we will do. | |||||||
> > |
| |||||||
Some helpful hints on how to proceed Generating the simulated data distributed as a Gaussian |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in one of the two sample papers link to from the PHY4821LSyllabus page. The lab report should be done independently, ie you and your partner(s) should turn your own work. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Also don't forget to cite all references properly. | |||||||
> > | This lab is to be accomplished mostly on a computer. There are three related parts to the lab. First, you will write a program to compute the value of pi using a random number generator and the acceptance/rejection Montecarlo method. You then use use the technique to compute the volume of an n-dimensional sphere and finally use your newly aquired computing skills to generate a set of data distributed as a Gaussian whihc you will fit a Gaussian functional form. This work will all be detailed in a report you'll write in the format of a modern physics journal. Please note that while you will work closely with your lab partner you are expected to write your own code and present to me as part of your grade. I strongly recommend that you do your programming work on the medianocher server that will be made available to you during the course. While it may be easier to do everything on your own PC or Mac it is likely that you will need to work on a linux server in yor should turn your own work. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Also don't forget to cite all references properly. | |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methodsAssignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This is the first lab that you will complete. Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in Dr. Raue's paper linked to from PHY4821LSyllabus page. This lab report should be done independently, ie everyone will turn one in. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Site all references properly. | |||||||
> > | Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in one of the two sample papers link to from the PHY4821LSyllabus page. The lab report should be done independently, ie you and your partner(s) should turn your own work. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Also don't forget to cite all references properly. | |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methodsAssignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Line: 26 to 26 | ||||||||
C. Generate and Fit a GaussianAssignment: Using Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF). | ||||||||
Changed: | ||||||||
< < | In this exercise you will be using a random number generator to create a sample distribution which will then be fitted to a PDF of the known form. This is another common use of the Monte Carlo method, in data analysis whereby distributions are created to simulate a phenomena of interest. In this lab you will first create the data and then use a fitting package or application to fit a known PDF to the data generated. Typically, in an experiment the data will come from the experiment instead of a computer but the data processing, data fitting and parameter estimation procedure can be learned from the simulated data we'll create here. | |||||||
> > | In this exercise you employ the Monte Carlo technique to generate a normal distribution which you will subsequently fit to a Gaussian Probability Distribution Function (PDF). This is another common use of the Monte Carlo method, especially in particle and nuclear physics. The Monte Carlo approach can be used to generate any kind of distribution useful when simulating a variety of phenomena. In this lab you will first create a data set process it and then use a fitting package, (an application with an interface to fitting algorithms). In an real experiments, particularly when the physical processes are difficult to extract or the data analysis is particularly sophisticated, the ability to simulate the reaction of the experiment to simulated data is a critical part of the data analysis procedure. | |||||||
Changed: | ||||||||
< < | There are essentially two parts to this lab. First you will generate and then process the a set of simulated data which when histogrammed will be distributed as Gaussian. To generate your simulated data distribution you will once again use a random number generator used previously to create a uniform distribution from 0 to 1. The uniformly distributed output will be applied in an algorithm to create the Gaussian distributed data. There are many different algorithms available to do this and a variety of sources exist to aid you, for example: there are a couple of ways described in the Particle Data Group Math Review section. Alternatives that are faster more or less accurate exists and you are encouraged to explore on the on the web. | |||||||
> > | There are essentially two parts to this lab. First you will use the same random number technique you used in parts A and B plus a suitable algorithm to create a Gaussian histogram. To generate your data distribution you will once again use a random number generator over interval 0 to 1. The uniformly distributed output will be applied in an algorithm to create the Gaussian distributed data. There are many different algorithms available to do this and a variety of sources exist to aid you, for example: there are a couple of ways described in the Particle Data Group Math Review section (http://pdg.lbl.gov/2011/reviews/rpp2011-rev-monte-carlo-techniques.pdf). Alternatives that are faster more or less accurate exists and you are encouraged to explore these on your own. | |||||||
Changed: | ||||||||
< < | Once you've coded the MC algorithm you will need to histogram the output, remember we are ultimately going to fit the histogram to a Gaussian PDF as part of this exercise. The histogramming process can be done in the code itself or you can feed the raw output data to histogramming package. In High Energy Particle physics we use HBOOK to histogram or ROOT or a variety of other applications. In fact, MS excel also has a histogramming feature built into the data analysis package. The easiest thing to do is to create your histogram directly in your Monte Carlo code. Once you have your histogram you will need to fit the simulated data you will need to fit with a fitting package. In principle you could write your own fitting package but this would be a considerable amount of work. Your best bet is to use an application with fitting built in. In this class we have made available a package that is relatively easy to use and very powerful. The package or application is deployed on the HEP analysis cluster and is called mn_fit. There are instructions below on how to use it and a online manual is available. Alternatively you can use the fitting packages in MATLAB, or Matehmatica if you so desired. I believe even MS excel can be coxed to do curve fitting, at least a simple Gaussian fit as we will do. | |||||||
> > | Once you've coded the MC algorithm you will need to histogram the output, remember we are ultimately going to fit the histogram to a Gaussian PDF as part of this exercise. The histogramming process can be done in the code itself or you can feed the raw output data to histogramming package. In Particle/Nuclear physics we use a set of libraries called ROOT to histogram things. There are some older packages, ie HBOOK (fortran based) that do the same thing. Other packages and applications probably exists as well. In fact, you are probably most familiar with Microsoft's excel program; it has a histogramming feature built into the data analysis package. The easiest thing to do is to create your histogram directly in your MC program. Once you have your histogram you will need to fit the simulated data with whatever fitting package you choose. Dr. Boeglin's Modern Physics class provided you with a new python based fitting package that will be more than suitable for this exercise. Also, I have dusted up a particularly simple but powerful package, called MINFIT, that I used in graduate school a few years ago. This package or application is available to you on the HEP analysis cluster (medianoche.hep.fiu.edu). To invoke it type its name "mn_fit" on the command line. There are instructions below on how to use it and an online manual is available. Alternatively you can use the fitting packages in MATLAB, or Matehmatica if you so desired. I believe even MS excel can be coxed to do curve fitting, at least a simple Gaussian fit as we will do. | |||||||
Some helpful hints on how to proceed Generating the simulated data distributed as a Gaussian |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Lab Assignment: Monte Carlo Techniques | ||||||||
Changed: | ||||||||
< < | This is the first lab that you will complete. Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in Dr. Raue's paper linked to from PHY4810LSyllabus page. This lab report should be done independently, ie everyone will turn one in. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Site all references properly. | |||||||
> > | This is the first lab that you will complete. Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in Dr. Raue's paper linked to from PHY4821LSyllabus page. This lab report should be done independently, ie everyone will turn one in. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Site all references properly. | |||||||
Part A. Calculate the value of π (pi) using Monte Carlo methodsAssignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%. | ||||||||
Line: 41 to 41 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
[jorge@medianoche ~/]$ mn_fit // hit return or type 2 to display the X11 graphics window MN_CMD> dat_fetch histogramDATA.mnd 0 // fetch the name of your ascii or hbook histogram (there is a sample data .mnd file attached below) MN_CMD> index // will list all histograms read into mnfit MN_CMD>plot 10&0 //to draw histogram 10 (histogram id=10 and secondary ID = 0) MN_CMD> fun add gaussian // add the Gaussian function as the fitting function, use the sigma type 1st prompt = sigma, 2nd = area, 3rd, mean, 4th = sigme, enter in reasonable starting points for these parameters to start the minimizer MN_CMD> fit 1 // fit the histogram number 1 with the function loaded into the fitter. You will have to select what type of fit to use. You can use the chi2 fit for this exercise. MINUIT> minimize // The fit command above puts you into the minimization and error analysis package called MINUIT. MINUIT is a set of functions algorithms and a complete package that's beenaround for ever. It may be of interest to you to spend some time exploring the documentation from CERN) MINUIT> display // Displays your histogram with the function overlayed and statistical and error analysis results MINUIT> minos // Recalculates the errors using a more sophisticated approach where the minimizer doesn't assume parabolic errors, for more info see documentation | |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Lab Assignment: Monte Carlo TechniquesThis is the first lab that you will complete. Please prepare a lab report written in the form of a Journal of Physics Article that has the form illustrated in Dr. Raue's paper linked to from PHY4810LSyllabus page. This lab report should be done independently, ie everyone will turn one in. For the lab report you may consult each other and myself but are expected to work somewhat independently, ie prepare your own program and turn in a unique report. Site all references properly.Part A. Calculate the value of π (pi) using Monte Carlo methodsAssignment: Calculate the value of π and find the number of events needed to get a statistical uncertainty of 1%, 0.1% and 0.00001%.
Part B. Calculate the Volume of an N-dimensional sphere (N=1-5)Assignment: Use Monte Carlo Methods to determine the volume of N-dimensional sphere of unit radius from N=1 to N=5.For this lab use 10,000 tries to determine the central value f the volume. In your results quote that and the associated statistical error. Also compare your result with theoretical value determined analytically.C. Generate and Fit a GaussianAssignment: Using Monte Carlo Methods generate a data distributed as a Gaussian, bin the data into a histogram and then fit the histogram with a Gaussian probability distribution function (PDF).In this exercise you will be using a random number generator to create a sample distribution which will then be fitted to a PDF of the known form. This is another common use of the Monte Carlo method, in data analysis whereby distributions are created to simulate a phenomena of interest. In this lab you will first create the data and then use a fitting package or application to fit a known PDF to the data generated. Typically, in an experiment the data will come from the experiment instead of a computer but the data processing, data fitting and parameter estimation procedure can be learned from the simulated data we'll create here. There are essentially two parts to this lab. First you will generate and then process the a set of simulated data which when histogrammed will be distributed as Gaussian. To generate your simulated data distribution you will once again use a random number generator used previously to create a uniform distribution from 0 to 1. The uniformly distributed output will be applied in an algorithm to create the Gaussian distributed data. There are many different algorithms available to do this and a variety of sources exist to aid you, for example: there are a couple of ways described in the Particle Data Group Math Review section. Alternatives that are faster more or less accurate exists and you are encouraged to explore on the on the web. Once you've coded the MC algorithm you will need to histogram the output, remember we are ultimately going to fit the histogram to a Gaussian PDF as part of this exercise. The histogramming process can be done in the code itself or you can feed the raw output data to histogramming package. In High Energy Particle physics we use HBOOK to histogram or ROOT or a variety of other applications. In fact, MS excel also has a histogramming feature built into the data analysis package. The easiest thing to do is to create your histogram directly in your Monte Carlo code. Once you have your histogram you will need to fit the simulated data you will need to fit with a fitting package. In principle you could write your own fitting package but this would be a considerable amount of work. Your best bet is to use an application with fitting built in. In this class we have made available a package that is relatively easy to use and very powerful. The package or application is deployed on the HEP analysis cluster and is called mn_fit. There are instructions below on how to use it and a online manual is available. Alternatively you can use the fitting packages in MATLAB, or Matehmatica if you so desired. I believe even MS excel can be coxed to do curve fitting, at least a simple Gaussian fit as we will do. Some helpful hints on how to proceed Generating the simulated data distributed as a Gaussian
[jorge@medianoche ~/]$ mn_fit // hit return or type 2 to display the X11 graphics window MN_CMD> dat_fetch histogramDATA.mnd 0 // fetch the name of your ascii or hbook histogram (there is a sample data .mnd file attached below) MN_CMD> index // will list all histograms read into mnfit MN_CMD>plot 10&0 //to draw histogram 10 (histogram id=10 and secondary ID = 0) MN_CMD> fun add gaussian // add the Gaussian function as the fitting function, use the sigma type 1st prompt = sigma, 2nd = area, 3rd, mean, 4th = sigme, enter in reasonable starting points for these parameters to start the minimizer MN_CMD> fit 1 // fit the histogram number 1 with the function loaded into the fitter. You will have to select what type of fit to use. You can use the chi2 fit for this exercise. MINUIT> minimize // The fit command above puts you into the minimization and error analysis package called MINUIT. MINUIT is a set of functions algorithms and a complete package that's beenaround for ever. It may be of interest to you to spend some time exploring the documentation from CERN) MINUIT> display // Displays your histogram with the function overlayed and statistical and error analysis results MINUIT> minos // Recalculates the errors using a more sophisticated approach where the minimizer doesn't assume parabolic errors, for more info see documentation
GradingRubric |