How to manually find R^2 value between a sinusoidal plot on a scatter plot

wine&bread17

New member
Joined
May 1, 2022
Messages
2
Hey guys,

I want to model a function based on a scatter plot that looks like cos (x) and I have a few questions. First of all, should I not take into consideration the outliers, which I would calculate just using the interquartile range? For a bit of context, I'm looking at the concentration of air pollutants across 2 years, so I have 24 values for the graph. Also, of course I have seen ways to model it just by looking at the min, max etc. and coming up with a function, but for regression are there more complicated ways by which I can approach this probem?
 
Hey guys,

I want to model a function based on a scatter plot that looks like cos (x) and I have a few questions. First of all, should I not take into consideration the outliers, which I would calculate just using the interquartile range? For a bit of context, I'm looking at the concentration of air pollutants across 2 years, so I have 24 values for the graph. Also, of course I have seen ways to model it just by looking at the min, max etc. and coming up with a function, but for regression are there more complicated ways by which I can approach this probem?
You are trying to model this on a single cosine curve? How much do you understand about the method of least squares regression?

-Dan
 
You are trying to model this on a single cosine curve? How much do you understand about the method of least squares regression?

-Dan
Since Fourier transform is unitary doing least square regression is equivalent to extracting first components from the Fourier transform of the data.
 
Since Fourier transform is unitary doing least square regression is equivalent to extracting first components from the Fourier transform of the data.
Yes, exactly. But a Fourier analysis will provide a series of sine and cosine terms. It sounded to me like the OP wanted to fit the data to a single cosine curve. That's why I was asking.

-Dan
 
Thanks for the suggestions! And to answer your question, I know the basics of least square regression, but only for linear plots. My current level of mathematics is just IB Maths SL (a.k.a highschool).

Yes, I want to fit the data for 24 months onto a single cos plot.

Hello!!

Can someone help me? I have a scatter plot for 2 years (monthly data for 24 months, hence 24 values), which looks period. I plotted a cos(x) graph and I saw that the calculator can also do a sinusoidal regression for you, also giving you the r^2 value. Does anyone know how I can calculate the r^2 value manually? It's for a maths project. Thank you in advance!
 
Hello!!

Can someone help me? I have a scatter plot for 2 years (monthly data for 24 months, hence 24 values), which looks period. I plotted a cos(x) graph and I saw that the calculator can also do a sinusoidal regression for you, also giving you the r^2 value. Does anyone know how I can calculate the r^2 value manually? It's for a maths project. Thank you in advance!
Do a Google search with

calculate R-square manually

as key-words.
 
Top