Empirical Model Building I: Objectives: By the end of this class you should be able to: find the equation of the “best fit” line for a linear model explain.

Slides:



Advertisements
Similar presentations
How Science works: Graphs.
Advertisements

11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
2D Plots 1 ENGR 1181 MATLAB 12.
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Class 7.2: Graphical Analysis and Excel Solving Problems Using Graphical Analysis.
1 Chapter 4 Curve Plotting with MATLAB MATLAB provides some very powerful features for plotting and labeling curves. These operations can be performed.
Kin 304 Regression Linear Regression Least Sum of Squares
Correlation and regression
11 Simple Linear Regression and Correlation CHAPTER OUTLINE
Mathematics and Graphing in Chemistry Lab 1. Outline Mathematics in Chemistry Units Rounding Digits of Precision (Addition and Subtraction) Significant.
The Cycle of Proof: Dealing with Data. Dealing with Data: Daily Learning Goal The student will be able to compile and interpret data using appropriate.
EGR 105 Foundations of Engineering I
Excel Part III Curve-Fitting, Regression Section 8 Fall 2013 EGR 105 Foundations of Engineering I.
Section 4.2 Fitting Curves and Surfaces by Least Squares.
Engineering Fundamentals and Problem Solving, 6e Chapter 5 Representation of Technical Information.
Statistics: Data Analysis and Presentation Fr Clinic II.
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
Excellence Justify the choice of your model by commenting on at least 3 points. Your comments could include the following: a)Relate the solution to the.
8 Statistical Intervals for a Single Sample CHAPTER OUTLINE
Chapter 11 Multiple Regression.
Chapter 5 Plotting Data Curve Fitting, Good Graphing Practices Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 9 Title and Outline 1 9 Tests of Hypotheses for a Single Sample 9-1 Hypothesis Testing Statistical Hypotheses Tests of Statistical.
9 - 1 Intrinsically Linear Regression Chapter Introduction In Chapter 7 we discussed some deviations from the assumptions of the regression model.
Inference for regression - Simple linear regression
The Power Function Studies of stream length and drainage basins determined an empirical relationship : L = 1.4 A 0.6 where L is stream length and A is.
Empirical Model Building Ib: Objectives: By the end of this class you should be able to: Determine the coefficients for any of the basic two parameter.
Introduction to MATLAB for Engineers, Third Edition Chapter 6 Model Building and Regression PowerPoint to accompany Copyright © The McGraw-Hill Companies,
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Descriptive Statistics II: By the end of this class you should be able to: describe the meaning of and calculate the mean and standard deviation of a sample.
Descriptive Statistics I: By the end of this class you should be able to: Palm: Section 7.1, 7.2 Program cords and delays in your music programs plot a.
Wednesday, May 13, 2015 Report at 11:30 to Prairieview.
Summarizing Bivariate Data
Lecture 8 Simple Linear Regression (cont.). Section Objectives: Statistical model for linear regression Data for simple linear regression Estimation.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
1 11 Simple Linear Regression and Correlation 11-1 Empirical Models 11-2 Simple Linear Regression 11-3 Properties of the Least Squares Estimators 11-4.
11/20/2015ENGR 111A - Fall MatLab – Palm Chapter 5 Curve Fitting Class 14.1 Palm Chapter:
Statistical Analysis Topic – Math skills requirements.
SEM Basics 2 Byrne Chapter 2 Kline pg 7-15, 50-51, ,
Understand linear equations and its types. Form the linear equations involving slopes of different situations. Students and Teachers will be able to.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
Chapter 8: Simple Linear Regression Yang Zhenlin.
Data Analysis, Presentation, and Statistics
Chapter 2 Data in Science. Section 1: Tools and Models.
Often the goal of an experiment is to find the relationship between two variables. As one variable changes, so does the other. Graphing is a useful way.
k is called the constant of variation or constant of proportionality.
Math 4030 – 7b Normality Issues (Sec. 5.12) Properties of Normal? Is the sample data from a normal population (normality)? Transformation to make it Normal?
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
Chapter 4 More on Two-Variable Data. Four Corners Play a game of four corners, selecting the corner each time by rolling a die Collect the data in a table.
AP PHYSICS 1 SUMMER PACKET Table of Contents 1.What is Physics? 2.Scientific Method 3.Mathematics and Physics 4.Standards of Measurement 5.Metric System.
Thursday, May 12, 2016 Report at 11:30 to Prairieview
BAE 6520 Applied Environmental Statistics
The Normal Distribution: Comparing Apples and Oranges
Rules for Graphing.
Kin 304 Regression Linear Regression Least Sum of Squares
BPK 304W Regression Linear Regression Least Sum of Squares
(Residuals and
Relationship between Current, Voltage, and Resistance
CHAPTER 29: Multiple Regression*
9 Tests of Hypotheses for a Single Sample CHAPTER OUTLINE
Warm-up We are going to collect some data and determine if it is “normal” Roll each pair of dice 10 times and record the SUM of the two digits in your.
The normal distribution
MatLab – Palm Chapter 5 Curve Fitting
Graphing Review.
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Graphing Rules: According to DRTAILSS
Regression Assumptions
Graphing.
Regression Assumptions
Presentation transcript:

Empirical Model Building I: Objectives: By the end of this class you should be able to: find the equation of the “best fit” line for a linear model explain the criteria for a “best fit” line linearize exponential and power models. use plots to determine if a linear, exponential or power model fits a given data set. Palm, Section 5.5 Download file FnDiscovery.mat and load into MATLAB

Review Exercise (pairs) The compressive strength of samples of a specific type of cement can be modeled by a normal distribution with a mean of 6000 kilograms per square centimeter and a standard deviation of 100 kilograms per square centimeter What is the variance of this compressive strength? What percent of a batch of cement samples is expected to be greater than 5800 kg/cm 2 ? Adapted from: Montgomery, Runger and Hubele, Engineering Statistics, 2 nd Ed., Wiley (2001)

68 % 95.5 % 99.7% Expected Proportions for known  Percentage of observations in the given range  1s  2 2  3 3 mean

Modeling Spring Lengthening Force (lb)Spring Length Increase (in.) What type of model (equation) would you use to represent the data below? Why?

Identifying an Empirical Model plot data (see points at left) looks linear equation:F = mL + b (y = mx + b) Here we are trying to determine an empirical model (an equation that matches the data shape but is not from theory). There is also a mechanistic (theoretical) model for this system from Hook’s law (F = k L) Note L = the change in length. Can you estimate the coefficients of this model? We will look at this more later m ~ 5, b ~ 0

Capacitor Discharge Data Plot this data. Can you fit a linear model to it? t = Time (s)V = Voltage (V)

Capacitor Discharge Example Commands to plot Graph >> plot(t, V, ‘s’) >> xlabel(‘time(sec)’) >> ylabel(‘Voltage(V)’) Notice: Curve is smooth and “monotonic” but not linear a monotonic curve is one that either is constantly increasing or constantly decreasing but never reverses direction for positive x We need another model Options (see following slide)

Three Basic Two-parameter Models (colored equations down on a blank paper) Linear Power Exponential or

Remember basic Log/ln rules Multiplication: log(ab) = log(a) + log(b) orln(ab) = ln(a) + ln(b) Powers: log(a m ) = m log(a) or ln(a m ) = m ln(a) For the power and exponential models you wrote down : Take the log of both sides and simplify

Transformation of Models (have students try, then do on board) power law model For:Y = log(y) X = log(x) B = log (b) Eqn becomes: Y = B + mX If the power law model applies a log-log plot should be linear exponential For Y = log(y) B = log (b) Eqn becomes: Y = B + mx If exponential model applies a semilogy plot should be linear

A few notes on MatLAB commands Log transformations: >> log(x)  the natural log of x (i.e., ln(x)) >> log10(x)  the base 10 log of x This pattern is typical for many programs Also remember: >> semilogy(x,y,...)  creates a plot with a log scale on the y axis >> loglog(x,y,...)  creates a plot with log scales on both axes

Try these transformations of capacitor discharge data (follow the leader exercise) Exponential Model – if model is exponential I should get a straight line when plotting log(V) vs t >> logV = log10(V) >> plot(t, logV, ‘p’) >> xlabel('time (sec)'); ylabel('log(Voltage (V))') % notice the y-axis must be labeled as the log of voltage. This looks to be the correct model, the data lines up nicely on a straight line

Can also plot using the semilogy command Commands (putting graph on a new figure) >> figure >> semilogy(t, V, ‘p’) >> xlabel('time (sec)'); ylabel('Voltage (V)') Notice we do not use the log in the y axis title this time. The y-axis is in the actual variable, the spacing on the axis is based on a the log of the value. Notice the difference in the look of the y- axis. Otherwise this graph is identical to the earlier plot

for comparison look at this data on other log-log plot Commands (putting graph on a new figure) >> figure >> loglog(t, V, ‘p’) >> xlabel('time (sec)'); ylabel('Voltage (V)') This graph is clearly not straight – the exponential model is our best option.

ModelEquationLinerized equation Plot (command) Linear linear (plot) Exponential semilog (semilogy) Power log-log (loglog) Function Discovery: 2-parameter models (Try to find a plot that makes the data look linear)

Handout: Function Discovery for monotonic functions Summary table (previous slide) –plus fitting models (we will cover next time) Assessing function type: –standard x-y plot –does data line up on a straight line?  linear model –is the data monotonic for positive x?  could be power law or exponential  plot semilog and log-log plots. linear on semilog  exponential model linear on loglog  power law model Table of MATLAB commands for reference Try the three problems (see following slides) Fitting models  what we need to do next

Aside: base 10 vs. base e exponential models  Different by a constant base 10 model y = b10 m1x log(y) = log(b) + log(10 m1x ) log(y) = log(b) + m 1 x log(10) log(10) = 1 log(y) = log(b) + m 1 x base e model y = be m2x log y = log(b) + log(e m2 x ) log(y) = log(b) + m 2 x log(e) log(e) = log(y) = log(b) m 2 x therefore: m 1 x = m 2 x m 1 = m 2

Exercise: Determine the likely model form for: 1.Deflection of a cantilever beam (F, d) 2.x1 vs. y1 3. x2 vs y2 Data vectors Available On handout In MATLAB data file FnDiscovery.mat

Problem 1: Deflection of a cantilever beam This problem uses the variables F & d in FnDiscovery.mat >> plot(F,d,'p') >> xlabel ‘Force (lbs)' >> ylabel ‘Deflection (in.)‘ >> title ‘Problem 1: Beam Deflection’ data points are in a straight line  the model is linear  d = mF + b

Handout Problem 2 This problem uses variables x1, y1 standard x-y plot >> plot(x1,y1,'p') >> xlabel 'x1', ylabel 'y1' >> title 'Handout Problem 2: linear plot‘ Result is monotonic but clearly non-linear Need to try semilog and log-log plots

Handout Problem 2 (cont.) >> subplot(2,1,1) >> semilogy(x1,y1,'p') >> xlabel 'x1', ylabel 'y1' >> title 'Handout Problem 2: semilog plot‘ >> >> subplot(2,1,2) >> loglog(x1,y1,'p') >> xlabel 'x1', ylabel 'y1' >> title 'Handout Problem 2: log-log plot‘ The log-log plot is linear  power model applies y1 = b(x1) m

Handout Problem 3 This problem uses variables x2, y2 standard x-y plot >> plot(x2,y2,'p') >> xlabel 'x2', ylabel 'y2' >> title 'Handout Problem 3: linear plot‘ Result is monotonic but clearly non-linear Need to try semilog and log-log plots

Handout Problem 3 (cont.) >> subplot(2,1,1) >> semilogy(x2,y2,'p') >> xlabel 'x2', ylabel 'y2' >> title 'Handout Problem 3: semilog plot‘ >> >> subplot(2,1,2) >> loglog(x2,y2,'p') >> xlabel 'x2', ylabel 'y2' >> title 'Handout Problem 3: log-log plot‘ Both plots are fairly linear. However, I would choose the semilog plot for two reasons. (1) exponential models are generally preferred to power and (2) there is some possible curvature in the log-log plot.  exponential model: y = b e mx