(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 47782, 1179] NotebookOptionsPosition[ 46332, 1126] NotebookOutlinePosition[ 46997, 1151] CellTagsIndexPosition[ 46954, 1148] WindowTitle->Linear and Quadratic Curve Fitting Practice - Source WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Linear and Quadratic Curve Fitting Practice", "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False, FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[BoxData[ GraphicsBox[RasterBox[CompressedData[" 1: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 FP/69esnAAAAAAAAAAAAwM74B4thROM= "], {{0, 0}, {1800, 25}}, {0, 255}, ColorFunction->RGBColor], ImageSize->{1800, 25}, PlotRange->{{0, 1800}, {0, 25}}]], "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False], Cell[BoxData[ RowBox[{ RowBox[{"PointToLSPolygon", "[", RowBox[{ RowBox[{"{", RowBox[{"x_", ",", "y_"}], "}"}], ",", "fn_", ",", "var_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sq", "=", RowBox[{"Sow", "[", RowBox[{ RowBox[{"(", RowBox[{"fn", "/.", RowBox[{"var", "\[Rule]", "x"}]}], ")"}], "-", "y"}], "]"}]}], "}"}], ",", RowBox[{"Tooltip", "[", " ", RowBox[{ RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x", "+", "sq"}], ",", "y"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x", "+", "sq"}], ",", RowBox[{"y", "+", "sq"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"y", "+", "sq"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"sq", "^", "2"}]}], "]"}]}], "]"}]}]], "Input", CellID->182637900], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ "pl", ",", "sqs", ",", "sqstot", ",", "bestfit", ",", "bestfitmodel", ",", "a", ",", "model", ",", "modelerror", ",", "x", ",", "w1", ",", "w2", ",", "w3"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Adjust", " ", "the", " ", "number", " ", "of", " ", "locators", " ", "according", " ", "to", " ", "the", " ", "type", " ", "of", " ", "fit", " ", "model"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Length", "[", "pts", "]"}], ">", "2"}], "&&", RowBox[{"Not", "[", "QuadraticFit", "]"}]}], ",", RowBox[{"pts", "=", RowBox[{"{", RowBox[{ RowBox[{"First", "[", RowBox[{"Sort", "[", "pts", "]"}], "]"}], ",", RowBox[{"Last", "[", RowBox[{"Sort", "[", "pts", "]"}], "]"}]}], "}"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Length", "[", "pts", "]"}], "<", "3"}], "&&", "QuadraticFit"}], ",", RowBox[{"AppendTo", "[", RowBox[{"pts", ",", RowBox[{"Mean", "[", "pts", "]"}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Create", " ", "model", " ", "and", " ", "data", " ", "sample"}], "*)"}], "\[IndentingNewLine]", RowBox[{"SeedRandom", "[", "seedrandom", "]"}], ";", "\[IndentingNewLine]", RowBox[{"model", "=", " ", RowBox[{"InterpolatingPolynomial", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", "10", "]"}]}], "}"}], ",", RowBox[{"If", "[", RowBox[{"QuadraticModel", ",", RowBox[{"{", RowBox[{ RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"2", ",", "8"}], "}"}], "]"}], ",", RowBox[{"RandomReal", "[", "10", "]"}]}], "}"}], ",", RowBox[{"Apply", "[", RowBox[{"Sequence", ",", RowBox[{"{", "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"10", ",", RowBox[{"RandomReal", "[", "10", "]"}]}], "}"}]}], "}"}], ",", "x"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"a", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{"(", RowBox[{"model", "/.", RowBox[{"x", "\[Rule]", RowBox[{"(", RowBox[{"i", "+", RowBox[{"RandomReal", "[", RowBox[{"If", "[", RowBox[{ RowBox[{"noisedistribution", "===", "\"\\""}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "Noise"}], ",", "Noise"}], "}"}], ",", RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Noise", "^", "2"}]}], "]"}]}], "]"}], "]"}]}], " ", ")"}]}]}], ")"}], "+", RowBox[{"RandomReal", "[", RowBox[{"If", "[", RowBox[{ RowBox[{"noisedistribution", "===", "\"\\""}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "Noise"}], ",", "Noise"}], "}"}], ",", RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Noise", "^", "2"}]}], "]"}]}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "10", ",", RowBox[{"10", "/", RowBox[{"(", RowBox[{"numpoints", "-", "1"}], ")"}]}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Solve", " ", "the", " ", "best", " ", "fit", " ", "problem"}], "*)"}], "\[IndentingNewLine]", RowBox[{"bestfitmodel", "=", RowBox[{"If", "[", RowBox[{"QuadraticFit", ",", "\[IndentingNewLine]", "\t\t\t\t\t", RowBox[{ RowBox[{"w1", "+", RowBox[{"w2", " ", "x"}], "+", RowBox[{"w3", " ", SuperscriptBox["x", "2"]}]}], "/.", "\[InvisibleSpace]", RowBox[{"FindFit", "[", RowBox[{"a", ",", RowBox[{"w1", "+", RowBox[{"w2", " ", "x"}], "+", RowBox[{"w3", " ", SuperscriptBox["x", "2"]}]}], ",", RowBox[{"{", RowBox[{"w1", ",", "w2", ",", "w3"}], "}"}], ",", "x"}], "]"}]}], ",", "\[IndentingNewLine]", "\t\t\t\t\t", RowBox[{ RowBox[{"w1", "+", RowBox[{"w2", " ", "x"}]}], "/.", "\[InvisibleSpace]", RowBox[{"FindFit", "[", RowBox[{"a", ",", RowBox[{"w1", "+", RowBox[{"w2", " ", "x"}]}], ",", RowBox[{"{", RowBox[{"w1", ",", "w2"}], "}"}], ",", "x"}], "]"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"bestfit", "=", RowBox[{"Total", "[", SuperscriptBox[ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"bestfitmodel", "/.", "\[InvisibleSpace]", RowBox[{"x", "\[Rule]", RowBox[{ "#1", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}]}], ")"}], "-", RowBox[{ "#1", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "&"}], ")"}], "/@", "a"}], ")"}], "2"], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"modelerror", "=", RowBox[{"Total", "[", SuperscriptBox[ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"model", "/.", "\[InvisibleSpace]", RowBox[{"x", "\[Rule]", RowBox[{ "#1", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}]}], ")"}], "-", RowBox[{ "#1", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "&"}], ")"}], "/@", "a"}], ")"}], "2"], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Score", " ", "the", " ", "current", " ", "manual", " ", "fit", " ", "and", " ", "construct", " ", "squares", " ", "in", " ", "case", " ", "they", " ", "are", " ", "to", " ", "be", " ", "seen"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"pl", ",", "sqs"}], "}"}], "=", RowBox[{"Reap", "[", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"PointToLSPolygon", "[", RowBox[{"#", ",", RowBox[{"InterpolatingPolynomial", "[", RowBox[{"pts", ",", "x"}], "]"}], ",", "x"}], "]"}], "&"}], ",", "a"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sqstot", "=", RowBox[{"Total", "[", RowBox[{ RowBox[{"Flatten", "[", "sqs", "]"}], "^", "2"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Generate", " ", "the", " ", "images"}], "*)"}], "\[IndentingNewLine]", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Show", "[", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"The", " ", "manual", " ", "fit"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"InterpolatingPolynomial", "[", RowBox[{"pts", ",", "x"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"Min", "[", RowBox[{"pts", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"Max", "[", RowBox[{"pts", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"The", " ", "raw", " ", "data"}], "*)"}], "\[IndentingNewLine]", RowBox[{"ListPlot", "[", RowBox[{"a", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"PointSize", "[", "0.03", "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"The", " ", "error", " ", "squares"}], "*)"}], "\[IndentingNewLine]", RowBox[{"Graphics", "[", RowBox[{"Prepend", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{"ShowSquares", ",", "pl", ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"Opacity", "[", "0.3", "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"The", " ", "solution", " ", "model"}], "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"ShowOriginalModel", ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Tooltip", "[", RowBox[{"model", ",", "\"\\""}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", "Green"}]}], "]"}], ",", RowBox[{"Graphics", "[", "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"ShowBestFit", ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Tooltip", "[", RowBox[{"bestfitmodel", ",", "\"\\""}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", "Blue"}]}], "]"}], ",", RowBox[{"Graphics", "[", "]"}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Set", " ", "appropriate", " ", "ranges"}], "*)"}], "\[IndentingNewLine]", RowBox[{"AspectRatio", "\[Rule]", "1"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"250", ",", "250"}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"MapAt", "[", RowBox[{ RowBox[{ RowBox[{"Min", "[", RowBox[{"#", ",", "0"}], "]"}], "&"}], ",", RowBox[{"MapAt", "[", RowBox[{ RowBox[{ RowBox[{"Max", "[", RowBox[{"#", ",", "10"}], "]"}], "&"}], ",", RowBox[{"Transpose", "[", RowBox[{ RowBox[{"ScalingTransform", "[", RowBox[{ RowBox[{"{", RowBox[{"1.1", ",", "1.1"}], "}"}], ",", RowBox[{"Mean", "[", "a", "]"}]}], "]"}], "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Min", "[", RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", RowBox[{"Min", "[", RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Max", "[", RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", RowBox[{"Max", "[", RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}]}], "}"}], "&"}], "[", RowBox[{"Transpose", "[", "a", "]"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1"}], "}"}]}], "}"}]}], "]"}]}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"250", ",", "250"}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Show", " ", "the", " ", "scoring", " ", "indicator"}], "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"ShowTotalSquares", ",", "\[IndentingNewLine]", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"GrayLevel", "[", "0.5", "]"}], ",", RowBox[{"Tooltip", "[", RowBox[{ RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "sqstot"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "sqstot"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], "}"}], "]"}], ",", "sqstot"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"ShowBestFit", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"Blue", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "bestfit"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "bestfit"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"ShowOriginalModel", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"Green", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "modelerror"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "modelerror"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", "}"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", RowBox[{"AspectRatio", "\[Rule]", "3"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", RowBox[{"20", " ", "numpoints"}]}], "}"}]}], ",", RowBox[{"ImageSize", "\[Rule]", "100"}], ",", RowBox[{"PlotLabel", "\[Rule]", "sqstot"}]}], "]"}], ",", "\"\< \>\""}], "]"}]}], "}"}], "}"}], "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"UI", " ", "Controls"}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "14", ",", "Bold"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"pts", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", "Locator"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"seedrandom", ",", "1", ",", "\"\\""}], "}"}], ",", "1", ",", "200", ",", "1", ",", " ", RowBox[{"ImageSize", "\[Rule]", "Small"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"QuadraticModel", ",", "True", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", "\"\< \>\"", ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "14", ",", "Bold"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"numpoints", ",", "10", ",", "\"\\""}], "}"}], ",", "3", ",", "50", ",", "1", ",", " ", RowBox[{"ImageSize", "\[Rule]", "Small"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Noise", ",", "1", ",", "\"\\""}], "}"}], ",", "0.01", ",", "3", ",", " ", RowBox[{"ImageSize", "\[Rule]", "Small"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "noisedistribution", ",", "\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", "\"\< \>\"", ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "14", ",", "Bold"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"QuadraticFit", ",", "True", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "ShowSquares", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "ShowTotalSquares", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "ShowOriginalModel", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ShowBestFit", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", RowBox[{"AutorunSequencing", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "3", ",", "5", ",", "7"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{ 3.35757176568782*^9, {3.367050329649907*^9, 3.3670503342750573`*^9}, { 3.3670589879148765`*^9, 3.3670591343836265`*^9}, {3.367059221805502*^9, 3.367059222618002*^9}, {3.367059328930502*^9, 3.3670593986336265`*^9}, { 3.3670594511336265`*^9, 3.367059469274252*^9}, {3.382275459415283*^9, 3.382275476134033*^9}, {3.382275564430908*^9, 3.382275594102783*^9}, { 3.383026128171875*^9, 3.38302615321875*^9}, {3.38302623846875*^9, 3.383026244859375*^9}, {3.383026331625*^9, 3.3830264244375*^9}, { 3.383026461203125*^9, 3.38302646321875*^9}, {3.3830265160625*^9, 3.3830265221875*^9}, {3.38302671865625*^9, 3.383026740078125*^9}, { 3.383026770546875*^9, 3.38302677253125*^9}, {3.3859854422321043`*^9, 3.3859854425758543`*^9}, {3.3859854747321043`*^9, 3.3859855253727293`*^9}, {3.3859855628727293`*^9, 3.3859855659664793`*^9}, {3.3859857001227293`*^9, 3.3859857077477293`*^9}, {3.3859857522789793`*^9, 3.3859857573883543`*^9}, {3.3859858237789793`*^9, 3.3859858605602293`*^9}, {3.385986354015625*^9, 3.3859863693125*^9}, 3.3859927464072247`*^9}, CellID->1496021318] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`Noise$$ = 1, $CellContext`noisedistribution$$ = "uniform", $CellContext`numpoints$$ = 10, $CellContext`pts$$ = {{1, 6}, { 4, 8}, {10, 1}}, $CellContext`QuadraticFit$$ = True, $CellContext`QuadraticModel$$ = True, $CellContext`seedrandom$$ = 1, $CellContext`ShowBestFit$$ = False, $CellContext`ShowOriginalModel$$ = False, $CellContext`ShowSquares$$ = False, $CellContext`ShowTotalSquares$$ = False, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[ Style["models", 14, Bold]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`pts$$], {{1, 6}, {4, 8}, {10, 1}}}, Automatic}, {{ Hold[$CellContext`seedrandom$$], 1, "data set"}, 1, 200, 1}, {{ Hold[$CellContext`QuadraticModel$$], True, "quadratic model"}, { True, False}}, { Hold[" "], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Style["sample data", 14, Bold]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`numpoints$$], 10, "number of data points"}, 3, 50, 1}, {{ Hold[$CellContext`Noise$$], 1, "error standard deviation"}, 0.01, 3}, {{ Hold[$CellContext`noisedistribution$$], "uniform", "error distribution"}, {"uniform", "normal"}}, { Hold[" "], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Style["fitting tools", 14, Bold]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`QuadraticFit$$], True, "quadratic fit"}, { True, False}}, {{ Hold[$CellContext`ShowSquares$$], False, "show error squares"}, { True, False}}, {{ Hold[$CellContext`ShowTotalSquares$$], False, "show sum of error squares"}, {True, False}}, {{ Hold[$CellContext`ShowOriginalModel$$], False, "show original model"}, {True, False}}, {{ Hold[$CellContext`ShowBestFit$$], False, "show best fit"}, { True, False}}}, Typeset`size$$ = {265., {122.5, 127.5}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`seedrandom$10901$$ = 0, $CellContext`QuadraticModel$10902$$ = False, $CellContext`numpoints$10903$$ = 0, $CellContext`Noise$10904$$ = 0, $CellContext`noisedistribution$10905$$ = False, $CellContext`QuadraticFit$10906$$ = False, $CellContext`ShowSquares$10907$$ = False, $CellContext`ShowTotalSquares$10908$$ = False, $CellContext`ShowOriginalModel$10909$$ = False, $CellContext`ShowBestFit$10910$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`Noise$$ = 1, $CellContext`noisedistribution$$ = "uniform", $CellContext`numpoints$$ = 10, $CellContext`pts$$ = {{1, 6}, {4, 8}, {10, 1}}, $CellContext`QuadraticFit$$ = True, $CellContext`QuadraticModel$$ = True, $CellContext`seedrandom$$ = 1, $CellContext`ShowBestFit$$ = False, $CellContext`ShowOriginalModel$$ = False, $CellContext`ShowSquares$$ = False, $CellContext`ShowTotalSquares$$ = False}, "ControllerVariables" :> { Hold[$CellContext`seedrandom$$, $CellContext`seedrandom$10901$$, 0], Hold[$CellContext`QuadraticModel$$, \ $CellContext`QuadraticModel$10902$$, False], Hold[$CellContext`numpoints$$, $CellContext`numpoints$10903$$, 0], Hold[$CellContext`Noise$$, $CellContext`Noise$10904$$, 0], Hold[$CellContext`noisedistribution$$, \ $CellContext`noisedistribution$10905$$, False], Hold[$CellContext`QuadraticFit$$, $CellContext`QuadraticFit$10906$$, False], Hold[$CellContext`ShowSquares$$, $CellContext`ShowSquares$10907$$, False], Hold[$CellContext`ShowTotalSquares$$, \ $CellContext`ShowTotalSquares$10908$$, False], Hold[$CellContext`ShowOriginalModel$$, \ $CellContext`ShowOriginalModel$10909$$, False], Hold[$CellContext`ShowBestFit$$, $CellContext`ShowBestFit$10910$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Block[{$CellContext`pl, $CellContext`sqs, $CellContext`sqstot, \ $CellContext`bestfit, $CellContext`bestfitmodel, $CellContext`a, \ $CellContext`model, $CellContext`modelerror, $CellContext`x, $CellContext`w1, \ $CellContext`w2, $CellContext`w3}, If[ And[Length[$CellContext`pts$$] > 2, Not[$CellContext`QuadraticFit$$]], $CellContext`pts$$ = { First[ Sort[$CellContext`pts$$]], Last[ Sort[$CellContext`pts$$]]}]; If[ And[Length[$CellContext`pts$$] < 3, $CellContext`QuadraticFit$$], AppendTo[$CellContext`pts$$, Mean[$CellContext`pts$$]]]; SeedRandom[$CellContext`seedrandom$$]; $CellContext`model = InterpolatingPolynomial[{{0, RandomReal[10]}, If[$CellContext`QuadraticModel$$, { RandomReal[{2, 8}], RandomReal[10]}, Apply[Sequence, {}]], {10, RandomReal[10]}}, $CellContext`x]; $CellContext`a = Table[{$CellContext`i, ReplaceAll[$CellContext`model, $CellContext`x -> $CellContext`i + RandomReal[ If[$CellContext`noisedistribution$$ === "uniform", {-$CellContext`Noise$$, $CellContext`Noise$$}, NormalDistribution[0, $CellContext`Noise$$^2]]]] + RandomReal[ If[$CellContext`noisedistribution$$ === "uniform", {-$CellContext`Noise$$, $CellContext`Noise$$}, NormalDistribution[ 0, $CellContext`Noise$$^2]]]}, {$CellContext`i, 0, 10, 10/($CellContext`numpoints$$ - 1)}]; $CellContext`bestfitmodel = If[$CellContext`QuadraticFit$$, ReplaceAll[$CellContext`w1 + $CellContext`w2 $CellContext`x + \ $CellContext`w3 $CellContext`x^2, FindFit[$CellContext`a, $CellContext`w1 + $CellContext`w2 \ $CellContext`x + $CellContext`w3 $CellContext`x^2, {$CellContext`w1, \ $CellContext`w2, $CellContext`w3}, $CellContext`x]], ReplaceAll[$CellContext`w1 + $CellContext`w2 $CellContext`x, FindFit[$CellContext`a, $CellContext`w1 + $CellContext`w2 \ $CellContext`x, {$CellContext`w1, $CellContext`w2}, $CellContext`x]]]; \ $CellContext`bestfit = Total[Map[ ReplaceAll[$CellContext`bestfitmodel, $CellContext`x -> Part[#, 1]] - Part[#, 2]& , $CellContext`a]^2]; $CellContext`modelerror = Total[Map[ ReplaceAll[$CellContext`model, $CellContext`x -> Part[#, 1]] - Part[#, 2]& , $CellContext`a]^2]; {$CellContext`pl, \ $CellContext`sqs} = Reap[ Map[$CellContext`PointToLSPolygon[#, InterpolatingPolynomial[$CellContext`pts$$, $CellContext`x], \ $CellContext`x]& , $CellContext`a]]; $CellContext`sqstot = Total[Flatten[$CellContext`sqs]^2]; Grid[{{ Show[ Plot[ Evaluate[ InterpolatingPolynomial[$CellContext`pts$$, $CellContext`x]], \ {$CellContext`x, Min[ Part[$CellContext`pts$$, All, 1]], Max[ Part[$CellContext`pts$$, All, 1]]}], ListPlot[$CellContext`a, PlotStyle -> PointSize[0.03]], Graphics[ Prepend[ If[$CellContext`ShowSquares$$, $CellContext`pl, {}], Opacity[0.3]]], If[$CellContext`ShowOriginalModel$$, Plot[ Tooltip[$CellContext`model, "original model"], {$CellContext`x, 0, 10}, PlotStyle -> Green], Graphics[]], If[$CellContext`ShowBestFit$$, Plot[ Tooltip[$CellContext`bestfitmodel, "best fit"], {$CellContext`x, 0, 10}, PlotStyle -> Blue], Graphics[]], AspectRatio -> 1, ImageSize -> {250, 250}, PlotRange -> MapAt[Min[#, 0]& , MapAt[Max[#, 10]& , Transpose[ ScalingTransform[{1.1, 1.1}, Mean[$CellContext`a]][ ({{ Min[ Part[#, 1]], Min[ Part[#, 2]]}, { Max[ Part[#, 1]], Max[ Part[#, 2]]}}& )[ Transpose[$CellContext`a]]]], {{1, 2}, {2, 2}}], {{1, 1}, { 2, 1}}], ImageSize -> {250, 250}, AxesOrigin -> {0, 0}], If[$CellContext`ShowTotalSquares$$, Graphics[{ GrayLevel[0.5], Tooltip[ Polygon[{{0, 0}, {1, 0}, {1, $CellContext`sqstot}, { 0, $CellContext`sqstot}, {0, 0}}], $CellContext`sqstot], If[$CellContext`ShowBestFit$$, {Blue, Line[{{0, $CellContext`bestfit}, { 1, $CellContext`bestfit}}]}, {}], If[$CellContext`ShowOriginalModel$$, {Green, Line[{{0, $CellContext`modelerror}, { 1, $CellContext`modelerror}}]}, {}]}, AspectRatio -> 3, PlotRange -> {0, 20 $CellContext`numpoints$$}, ImageSize -> 100, PlotLabel -> $CellContext`sqstot], " "]}}]], "Specifications" :> { Style[ "models", 14, Bold], {{$CellContext`pts$$, {{1, 6}, {4, 8}, {10, 1}}}, Automatic, ControlType -> Locator}, {{$CellContext`seedrandom$$, 1, "data set"}, 1, 200, 1, ImageSize -> Small}, {{$CellContext`QuadraticModel$$, True, "quadratic model"}, { True, False}}, " ", Style[ "sample data", 14, Bold], {{$CellContext`numpoints$$, 10, "number of data points"}, 3, 50, 1, ImageSize -> Small}, {{$CellContext`Noise$$, 1, "error standard deviation"}, 0.01, 3, ImageSize -> Small}, {{$CellContext`noisedistribution$$, "uniform", "error distribution"}, {"uniform", "normal"}}, " ", Style[ "fitting tools", 14, Bold], {{$CellContext`QuadraticFit$$, True, "quadratic fit"}, { True, False}}, {{$CellContext`ShowSquares$$, False, "show error squares"}, { True, False}}, {{$CellContext`ShowTotalSquares$$, False, "show sum of error squares"}, { True, False}}, {{$CellContext`ShowOriginalModel$$, False, "show original model"}, { True, False}}, {{$CellContext`ShowBestFit$$, False, "show best fit"}, {True, False}}}, "Options" :> {AutorunSequencing -> {1, 3, 5, 7}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{557., {155., 160.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>(({$CellContext`PointToLSPolygon[{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}, Pattern[$CellContext`fn, Blank[]], Pattern[$CellContext`var, Blank[]]] := Block[{$CellContext`sq = Sow[ReplaceAll[$CellContext`fn, $CellContext`var -> \ $CellContext`x] - $CellContext`y]}, Tooltip[ Polygon[{{$CellContext`x, $CellContext`y}, {$CellContext`x + \ $CellContext`sq, $CellContext`y}, {$CellContext`x + $CellContext`sq, \ $CellContext`y + $CellContext`sq}, {$CellContext`x, $CellContext`y + \ $CellContext`sq}, {$CellContext`x, $CellContext`y}}], $CellContext`sq^2]], Attributes[PlotRange] = {ReadProtected}}; Typeset`initDone$$ = True); ReleaseHold[ HoldComplete[{$CellContext`PointToLSPolygon[{ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`y, Blank[]]}, Pattern[$CellContext`fn, Blank[]], Pattern[$CellContext`var, Blank[]]] := Block[{$CellContext`sq = Sow[ReplaceAll[$CellContext`fn, $CellContext`var -> \ $CellContext`x] - $CellContext`y]}, Tooltip[ Polygon[{{$CellContext`x, $CellContext`y}, {$CellContext`x + \ $CellContext`sq, $CellContext`y}, {$CellContext`x + $CellContext`sq, \ $CellContext`y + $CellContext`sq}, {$CellContext`x, $CellContext`y + \ $CellContext`sq}, {$CellContext`x, $CellContext`y}}], $CellContext`sq^2]]}]]; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->343085217], Cell[CellGroupData[{ Cell["CAPTION", "Section", CellFrame->{{0, 0}, {1, 0}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell["\<\ Practice fitting lines and curves to sample datasets, then compare your fit \ to the best possible. \ \>", "Text"] }, Close]] }, Open ]], Cell["\<\ You can choose to fit straight lines or quadratic curves to the data, and can \ choose data based on an underlying straight line or quadratic data.\ \>", "Text"], Cell[TextData[{ "Drag the locators to move the line and attempt to get the line to be the \ best fit possible for the random data. For extra help show the error squares \ (the square of the ", Cell[BoxData[ FormBox["y", TraditionalForm]], "InlineMath"], " axis distance between the points and your line) and try to minimize these. \ For further help show the sum of error squares and try to minimize that. " }], "Text"], Cell["\<\ When you think you have the best fit, show the actual best fit and see how \ close you were. Then experiment with different datasets, models, and error \ sizes.\ \>", "Text"], Cell["\<\ The best fit shown automatically minimizes the sum of squares differences \ between the data and fitted values. For (assumed) normally distributed \ errors, it can be generally assumed that least squares is the best fit \ possible. For other distributions, least squares will for instance not be the \ maximum likelihood estimate (which is commonly the criterion for best fit).\ \>", "Text"], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 0}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "\"", ButtonBox["Linear and Quadratic Curve Fitting Practice", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/\ LinearAndQuadraticCurveFittingPractice/"], None}, ButtonNote-> "http://demonstrations.wolfram.com/LinearAndQuadraticCurveFittingPractice/\ "], "\"", " from ", ButtonBox["the Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/\ LinearAndQuadraticCurveFittingPractice/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/\ LinearAndQuadraticCurveFittingPractice/"], None}, ButtonNote-> "http://demonstrations.wolfram.com/LinearAndQuadraticCurveFittingPractice/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[TextData[{ "Contributed by: ", ButtonBox["Jon McLoone", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Jon+McLoone"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Jon+McLoone"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6], CellID->678788666], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " system (Version 6 or higher) is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.87, 0.87, 0.87], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[1, 1, 1]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ LinearAndQuadraticCurveFittingPractice"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", CellInsertionPointCell->None, WindowSize->{757, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Linear and Quadratic Curve Fitting Practice - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[645, 23, 163, 3, 70, "Section"], Cell[811, 28, 3700, 64, 70, "Section"], Cell[4514, 94, 1138, 36, 70, "Input", CellID->182637900], Cell[5655, 132, 21722, 528, 70, "Input", CellID->1496021318] }, Open ]], Cell[CellGroupData[{ Cell[27414, 665, 13399, 286, 70, "Output", CellID->343085217], Cell[CellGroupData[{ Cell[40838, 955, 209, 6, 70, "Section"], Cell[41050, 963, 124, 3, 70, "Text"] }, Close]] }, Open ]], Cell[41200, 970, 171, 3, 70, "Text"], Cell[41374, 975, 424, 8, 70, "Text"], Cell[41801, 985, 184, 4, 70, "Text"], Cell[41988, 991, 401, 6, 70, "Text"], Cell[CellGroupData[{ Cell[42414, 1001, 355, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[42772, 1012, 1026, 30, 70, "Text"], Cell[43801, 1044, 450, 15, 70, "Text", CellID->678788666], Cell[CellGroupData[{ Cell[44276, 1063, 815, 24, 70, "Text"], Cell[45094, 1089, 1210, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature @Szo2n85y@aGnDpv7sqhp2A4 *)