Mathematical Modeling: Regression

B' would be B'/2π).In summary, the conversation is about a problem involving fitting a sinusoidal periodic function to given data points for restaurant reservations. The form of the function is f(t) = A sin ((2π/7) t) + B cos ((2π/7) t) or f(t) = C sin ((2π/7) t + D), and the goal is to find the values for A, B, C, and D that minimize the sum of squared errors. The variable t represents time in days, with Monday as t = 0 and Sunday as t = 6. To find A, B, and D, certain calculations are done using the maximum and
  • #1
FritoTaco
132
23

Homework Statement


Restaurant Reservations for a given week were:
Monday - 34
Tuesday - 27 (minimum value)
Wednesday - 33
Thursday - 47
Friday - 58
Saturday - 61 (maximum value)
Sunday - 42

Homework Equations


I don't think you need these equations to help me solve what I'm stuck on
Amplitude: Midline - minimum
Midline: Max + min / 2
Period: b = 2|max + min| then 2pi / b

The Attempt at a Solution


What I don't understand is how to get the sine function of what I highlighted. I think you have to look at the parent function of sin and cos and try to get to sin. If I'm originally at (x-6) according to my Cosine function to the left of my Sine Function, where is that on the graph table of Cosine? And how do I get my new value if I want to go to the start of Sine?
IMG_0146 (2).JPG

IMG_0147 (1) (2).JPG
 
Physics news on Phys.org
  • #2
HI FritoTaco:

The problem statement does not describe the problem to be solved. Presumably it has something to do with calculating a regression curve that best fits the data, but what are the constraints about the family of curves you can use?

Regards,
Buzz
 
  • #3
Buzz Bloom said:
HI FritoTaco:

The problem statement does not describe the problem to be solved. Presumably it has something to do with calculating a regression curve that best fits the data, but what are the constraints about the family of curves you can use?

Regards,
Buzz

Hi Buzz, are you asking about the parent functions and the domain and range? Because I don't think that matters for this. I just don't understand how to go from Cosine Function to Sine Function. I understand how to get Cosine function because that's what I did but Sine function is suppose to change. That's what I don't understand how to do but I think I need to look at the parent function. Ignore the Run a Sin-Regression because that's just the calculators calculation. Any ideas though?
 
  • #4
FritoTaco said:
are you asking about the parent functions and the domain and range?
FritoTaco said:
I just don't understand how to go from Cosine Function to Sine Function.
Hi FritoTaco:

I do not know what "parent function" means.
I do not understand why you are fitting the data to a sin or cos (or combination).

FritoTaco said:
I understand how to get Cosine function because that's what I did but Sine function is suppose to change.
I do not understand why you can fit a cos function, but a sin function is "suppose to change".

I expect that a problem statement sets up all the requirements for what is expected in a correct solution. You seem to have a lot of ideas about sin and cos functions that are not explained in the problem statement.

Regards,
Buzz
 
  • #5
Buzz Bloom said:
Hi FritoTaco:

I do not know what "parent function" means.
I do not understand why you are fitting the data to a sin or cos (or combination).I do not understand why you can fit a cos function, but a sin function is "suppose to change".

I expect that a problem statement sets up all the requirements for what is expected in a correct solution. You seem to have a lot of ideas about sin and cos functions that are not explained in the problem statement.

Regards,
Buzz

The reason I'm having trouble explaining this is because I don't know why the Sine function is suppose to change either. I can calculate the cosine function as I did but I need to move the horizontal shift so it matches the Sine function. The parent function is the 2 graphs shown in the second picture of Sine and Cosine, It's just suppose to guide you on how far the horizontal shift should change. I tried looking this up online but couldn't find any solutions. I don't know what I should do.
 
  • #6
Hi FritoTaco:

While I find the way you have expressed the problem to be confusing, I think I am beginning to get what you are trying to do.

I think you are looking for a sinusoidal periodic function that best fits the data. The period is given as one week. (I am guessing that this is because each week's daily reservation counts are expected to be similar to other weeks.)

The form of the function you want to fit to the data is
f(t) = A sin ((2π/7) t) + B cos ((2π/7) t).
Alternatively you can fit to
f(t) = C sin ((2π/7) t + D).
These two forms are equivalent to each other, since if you know A and B, you can calculate C and D, and vice versa.

You want to find the values for A and B, or for C and D, which minimizes the sum of the errors squared. Do you know how to do this?

Regards,
Buzz
 
  • #7
Hey Buzz, I have A, B, and D, I don't know how to calculate for C? Also, what is the variable t in f(t) = A sin ((2π/7) t) + B cos ((2π/7) t)? Is that suppose to be D?
 
  • #8
Hi FritoTaco:

t is time in days. Since you list Monday first, you can make t=0 be Monday, t = 1 be Tuesday, etc.

It seems unlikely that you can have the correct value for C independently of D. To figure out how C and D relate to A and B, you need to know the formula for the following:
sin(x+y) = ?

Do you know this? If not, you can probably find it in your textbook or on the internet.

Can you post your work on how you got A and B?

Regards,
Buzz
 
  • #9
hey Buzz, I have shown how to get A and B, and even D. A value: Mid - min (44-27 = 17), and B value: 2|max - min|, so 2|6-2| = 2|4| = 8. But use 7 instead because 7 days a week. (b = 2pi / 7 = 0.89). So now I need to use sin(x+y)?
 
  • #10
FritoTaco said:
What I don't understand is how to get the sine function of what I highlighted.
Not sure I have understood, but I think all you are asking is how to take an equation like y=Asin(Bx+C) and turn it into y=Acos(B'x+C').
If so, consider what sin(π/2-θ) equates to.
(Note my use of B' in the cos form.)
 
  • #11
Hi FritoTaco:

It seems that both haruspex and I are unsure what the problem is you are trying to solve. I will make one more try.

You use the word "regression" in the title of this thread. The following is my understanding of what "regression" WRT your problem statement.
Buzz Bloom said:
You want to find the values for A and B, or for C and D, which minimizes the sum of the errors squared.
The work shown in both of your attachments do not show any such a calculation. What do you think "regression" means?

Regards,
Buzz
 
  • #12
It's fine, I was trying to see if there were any ideas which there were but couldn't conclude the problem. I do not understand the term regression. I didn't know how to show calculations for going from sine to cosine. No problem, thank you so much for your efforts.
 
  • #13
haruspex said:
Not sure I have understood, but I think all you are asking is how to take an equation like y=Asin(Bx+C) and turn it into y=Acos(B'x+C').
If so, consider what sin(π/2-θ) equates to.
(Note my use of B' in the cos form.)

I was actually trying to get cosine to sine
 
  • #14
  • #15
FritoTaco said:
I was actually trying to get cosine to sine
Yes, sorry, typo. But what I posted is still relevant.
 

1. What is mathematical modeling?

Mathematical modeling is the process of using mathematical equations and techniques to describe and understand real-world phenomena. It involves creating a simplified representation of a complex system in order to make predictions and gain insights.

2. What is regression analysis?

Regression analysis is a statistical method used to find the relationship between two or more variables. It involves fitting a line or curve to a set of data points in order to make predictions about future data.

3. What is the purpose of using regression in mathematical modeling?

The purpose of using regression in mathematical modeling is to identify and quantify the relationship between variables. This allows for the creation of a predictive model that can be used to make informed decisions and understand the underlying patterns in the data.

4. What types of data are suitable for regression analysis?

Regression analysis can be used with both numerical and categorical data. However, the data should have a linear or approximately linear relationship in order for the regression model to be accurate.

5. What are some common applications of regression analysis in mathematical modeling?

Regression analysis is commonly used in various fields such as economics, finance, and social sciences to make predictions and understand relationships between variables. It is also used in machine learning and data science to create predictive models for various applications such as forecasting and classification.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
1
Views
819
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
16
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
424
  • Calculus and Beyond Homework Help
Replies
3
Views
953
  • Computing and Technology
Replies
4
Views
1K
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
960
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
790
  • Art, Music, History, and Linguistics
2
Replies
51
Views
6K
Back
Top