1. Trang chủ
  2. » Ngoại Ngữ

Lab17-1010_Statistical_Analysis_Sec1

10 1 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 914,82 KB

Nội dung

Class #17: Statistical Analysis and Rectangular Matrices Purpose: The objective of this experiment is to familiarize yourself with common statistical analysis terms and revisit linear curve fitting with multiple inputs Background: Before doing this experiment, students should be able to Analyze simple circuits consisting of combinations of resistors Apply Ohm’s Law to determine current from voltage measurements Make differential voltage measurements using M1K board and Alice tools Invert a matrix and perform matrix multiplication Use Matlab to perform linear regression and matrix manipulation Review the background for the previous experiments Learning Outcomes: Students will be able to Understand the properties of Gaussian distributions Use statistical parameters to determine the quality of their least squares curve fitting Use matrix mathematics to determine a linear fit for multiple input variables Equipment Required: M1K board (with Alice tools) or Analog Discovery (with Waveforms Software) Voltmeter tool (Alice) Meter-Source tool (Alice) Parts kit Matlab Keywords: Histogram Mean Standard Deviation Median Correlation Coefficient Helpful links for this experiment can be found on the course website under Class #17 J Braunstein, M Hameed Rensselaer Polytechnic Institute -1- Revised: 27 October 2021 Troy, New York, USA Part A – Statistical Analysis (Gaussian and Uniform Distribution) Background In the last experiment, we looked at fitting a linear approximation to data In this experiment, we will look at a more general discussion of data distributions and then revisit the data from last experiment To start off, we can consider a very common data distribution called the Gaussian distribution (Gaussian function) This distribution is one we see frequently when discussing test grades Mathematically, we can represent the Gaussian distribution as x x f x 2 → e 2 OH mean of stdcx ) (x ) = var =µ (X ) where x is the mean (average), which we used in experiment 16 (previous class) when determining the slope and intercept of the least squares fit, and is the standard deviation The standard deviation is a measure of how ‘spread out’ the distribution appears Considering the following two figures, Figure A-1 is an example of ‘wide’ Gaussian distribution with a ‘larger’ standard deviation and Figure A-2 is an example of a ‘narrow’ Gaussian distribution with a ‘smaller’ standard deviation We can clearly see that a smaller standard deviation looks much ‘narrower’ As mentioned above, this type of distribution is commonly associated with grades, where the mean is average assigned grade (C range perhaps) and a positive standard deviation would be one letter higher (B range perhaps) A negative standard deviation would be one letter grade lower (D range perhaps) Figures A-1 and A-2 are continuous plots, where the input can be any real value between and 100, not just integers When we consider data gathered, our measurements from last experiment as an example, the data set is then discrete We can fit a Gaussian curve to that data, using a procedure similar to the least squares operation in the last class Another approach is to use a histogram, which counts the frequency of data points within a range of values This type of plot is especially useful when considering a data set that is integers Again, using grades as an example, Figure A-3 is a histogram plot of exam grades Observationally, we can see that the data is approximately Gaussian Discrete data analysis (matrix analysis), indicates that the mean is 64.9 and the standard deviation is 16.2 If we implement curve fitting, the plot in Figure A3 would be very close to the Gaussian fit t.in Amplitude mmfmfnm * | PDF • f Time Variance = Cstd) " PDF =/ -00 ' -7 Figure A-1: Gaussian Distribution, Mean = 55, Std Dev = 15 (largish) J Braunstein, M Hameed Rensselaer Polytechnic Institute -2- ✗ Revised: 27 October 2021 Troy, New York, USA Figure A-2: Gaussian Distribution, Mean = 65, Std Dev = 15 (smallish) pa,,z ECSE 2410 Exam I Figure A-3: Histogram of Exam grades, Mean = 64.9, Std Dev = 16.6 In the case of discrete data sets, another metric of interest is the median, which is the ‘middle’ data point when sorting the data from smallest to largest (or largest to smallest) For example, the array 9 After sorting, the array becomes 9 and the median (middle number) is In general, if the data set is symmetrical, like the Gaussian distribution in Figure A-3, the median and mean are very close to each other The median of the Figure A-3 data was 64, which is very close to the mean ?⃝ J Braunstein, M Hameed Rensselaer Polytechnic Institute -3- Revised: 27 October 2021 Troy, New York, USA Two other common distributions are the Uniform distribution, where the frequency of occurrence is flat over the range of data In this type, each outcome (score) is equally likely You can see an example of that in Figure A-6 A Bimodal distribution is a data set with two different Gaussian distributions Examples are shown Figures A-7 (example curve) and A-8 (real exam data) In the case of scores, instructors are frequently disturbed by Bimodal distributions, leading to a lot of discussion about the course Figure A-6: Example of a Uniform Distribution Figure A-7: Example of a Bimodal Distribution ' bins y ✓ ✓ ✓ ✓ I Figure A-8: Bimodal Distribution of Exam Scores J Braunstein, M Hameed Rensselaer Polytechnic Institute -5- Revised: 27 October 2021 Troy, New York, USA Randiness pseudo-random -÷ am Exercise: 4) Revisit the three element arrays from experiment 16 and find the correlation coefficients a (2,1),(3,2),(4,3) b (1,1),(3,3),(5,2) Based on the Matlab calculations, would you characterize this data sets as linear? 5) Do the same for your linear fit analysis of the experiment 5, experiment 11, Part C, and from experiment 16, Part F data In this case, when you import the Excel data, you can use the column labels in the corrcoef command instead of writing the arrays directly Using the example from experiment 16, you could write >> corrcoef(Vs,VR2) Again, based on the Matlab calculations, would you characterize the results as linear? Part C –Linear Approximations with Two Inputs Background Figure C-1: Non-linear Circuit In Figure C-1, we see a circuit with two input voltages This circuit is very similar to the superposition circuit seen in experiment 11, In this case, we are going to look at the current through resistor R3 If the circuit was linear, then using experiment 11 concepts, we could write the current as I R3 aV1 bV2 where a and b are the coefficients for a linear relationship With the LED in the circuit, the relationship is not linear, but a linear approximation may be valid To find the coefficients a and b, we can use matrix analysis We still want a solution to the expression, Ax b Again, we are using measured data to extract the unknown coefficients a and b We will have multiple measurements, but only two unknowns, which means that the matrix A is rectangular, not square Each row of A is the values of V1 and V2, with the corresponding element of b being the measurement result We need to make changes to our matrix expression in order to find a solution In order to make the systems square, we multiply both sides of the expression by the transpose of A AT A x AT b The transpose of a matrix is obtained by switching the row and column elements, an element in row i and column j is placed in row j and column i As an example, For matrix A , with a transpose AT 1 In Matlab, the transpose command is transpose, >> transpose(A) J Braunstein, M Hameed Rensselaer Polytechnic Institute -8- Revised: 27 October 2021 Troy, New York, USA [ A Row / I ] reductions f- la ] " 2×2 3×3 2×5 ?⃝ [ Is " " " or 'ƠƠy Inf solutions [ f- 11 ì equation unknown S 1) Hill " " ✗ = b / → to Want square ✗ ✗ A b = A = make 2×5 A) = 5×2 this = b AT 5×2 ATA ?⃝ ?⃝ Ax " Atb → ⑤ 2×5 ] 2×2

Ngày đăng: 20/10/2022, 23:46

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...