Skip to main content
1-Visitor
February 29, 2016
Question

Regression on data

  • February 29, 2016
  • 6 replies
  • 19940 views

I am having a set of data that I have plottet in to a X-Y plot. But I would like to know the equation of these data, so that I can calculate the point where they are crossing each other. I have tried searching around both in this forum and other sites, but I have not been able to find a solution.

I have attached both a jpg file and a mathcad file.

6 replies

23-Emerald I
February 29, 2016

You have a lot of regression curves to choose from.  Once you have the equation, solving for the intersection is easy.

1-Visitor
February 29, 2016

Could you be more specific on how I have to do it. I am totally lost. Those guides I find online seem very complicated compared to my level. I thougt I could just choose polyfit(x,y) and then it would give me the function.

19-Tanzanite
February 29, 2016

Polyfit makes it a little simpler, but it doesn't change much.

25-Diamond I
March 1, 2016

Using linear or spline interpolation you won't see an explicit equation but you can use the result like any other function:

WE

BTW, in case you wonder why we all don't use the sheet you posted but instead used the sheet where Fred retyped the part of the data which was visible from the picture you posted.

Fred, Richard and me - neither of us has Prime 3.1 installed (just 3.0) and so we are unable to open files in P3.1 format. As you can't save in P3.0 format, screenshots or pdf-prints are the only way to communicate your problem/worksheet.

Of course your Prime 3.1 can read our P3.0 files.

24-Ruby IV
March 1, 2016

If we have one equation better use not the Find but the root function

25-Diamond I
March 1, 2016

Root sure is an alternative, but I don't see why it should be "better".

Unless you are using Prime Express and can't use a solve block, of course.

1-Visitor
March 1, 2016

FredKohlhepp‌ I didn't see your attached file at first. I am sorry about that.


In the line with vs:=regress(x,y,5) what is does the 5 mean?

In the line with Fn(x,,vs): I have no clue what is happening after the equation sign. Is it somehting you have typed, or is this given by Mathcad in someway?

I appreciate the help you guys are giving me, even though I am a asking a lot of questions.

19-Tanzanite
March 1, 2016
In the line with vs:=regress(x,y,5) what is does the 5 mean?

The order of the polynomial that regress fits to the data.

In the line with Fn(x,,vs): I have no clue what is happening after the equation sign. Is it somehting you have typed, or is this given by Mathcad in someway?

The regress function returns the coefficients of a polynomial in the vector vs. The coefficients start at the fourth element of the vector (the first three elements are other information; you can ignore them). The summation represents that polynomial: vs0*x^0 + vs1*x^1 + vs2*x^2 + ...

1-Visitor
March 2, 2016

Thanks a lot.

It seems a lot more difficult tthan wordmath.

25-Diamond I
March 2, 2016

Tommi Lauridsen wrote:

Thanks a lot.

It seems a lot more difficult tthan wordmath.

Whats wordmath?

1-Visitor
March 2, 2016

WordMath is an add-on for Word. It is actually working very well for a lot of things.

1-Visitor
March 3, 2016

I can try doing it in the weekend

1-Visitor
March 4, 2016

This is an example of how it could be done in WordMat . It is done very quick, and there is some autogenerated danish word in the document. Hope it makes sense to you.

I have found another another problem in MathCad. I can't multiply two matrices? It seems like instead of multiplying it is adding all of the numbers in the matrices each of them and multiplying them afterwards. I have no problems if I am dividing them?

I have attached a file showing imy problem. I get only one solution. Instead of a solution for each row?

25-Diamond I
March 4, 2016

You are multiplying two vectors and what you get is the scalar product - so all ist OK.

You want a vector as result where the first component is the product of the first components of the two initial vectors. Thats not what matrix or vector product ist meant for from a mathematical point of view.

But Mathcad has a solution for this which is called vectorization. You have to vectorize the product (matrix palette, they symbol is the right arrow) to get what you want to see.

R

1-Visitor
March 4, 2016

Thanks. That solved my problem!