Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Using LeastSquares to model data' topicStudent Support Forum > General > "Using LeastSquares to model data"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ya
03/23/09 9:31pm

I'm having problems finding the LeastSquares and my data's residuals in Mathematica.
I keep getting errors and I've researched the topic for the nth time now.

This is how far I've gone

Code→
xData := forp[[All, 1]];
yData := forp[[All, 2]];
mat = Transpose[{Table[1, {Length[xData]}], xData}];
mat // MatrixForm;
PseudoInverse[mat].yData;
sol = FindFit[forp, \[Alpha] + \[Beta] x, {\[Alpha], \[Beta]}, x];
Plot[(\[Alpha] + \[Beta] x) /. sol, {x, -10, -10},
Epilog \[RightArrow] First[fp1]]



Somehow i keep one getting this error whenever I try running this
" Plot[(\[Alpha] + \[Beta] x) /. sol, {x, -10, -10},
Epilog \[RightArrow] First[fp1]]"

error
Plot::nonopt: "Options expected (instead of \
Epilog\[RightArrow]First[fp1]) beyond position 2 in Plot[\[Alpha]+\
\[Beta]\ x/.sol,{x,-10,-10},Epilog\[RightArrow]First[fp1]]. An option \
must be a rule or a list of rules"

There are no problems with my code so far so I'm not sure what's wrong. (I don't think I need a package)
If you know how to fix this problem, your help is highly anticipated.

thanks

I've Attached a file that contains some errors with finding The leastSquares and my Data's residuals.
The parts that have to do with residuals and finding the LeastSquares are parts
"Yurold problem"
"Indicies vs Deaths."
"Data"
"The Leaning tower of Pisa"
"-median and Least Squares Comparison."

Attachment: Plots [cw & hw].nb, URL: ,

Subject (listing for 'Using LeastSquares to model data')
Author Date Posted
Using LeastSquares to model data Ya 03/23/09 9:31pm
Re: Using LeastSquares to model data yehuda ben-s... 03/29/09 11:47am
Next Comment >Help | Reply To Topic