0

I'm trying to fit a dataset to a periodic model of data (simplified as $F = A\sin(x/T)+B\cos(x/T),$ where $A,~ B,$ and $T$ are the model parameters) using python. I've been encouraged to use linear regression to do so - something I'm finding challenging, as the parameters don't seem to be exclusively linear, and I can't make them so. If there is a way to analyse this via linear regression, I'd love to understand more, or if I ought to look into other forms of curve fitting, I'd like to know.

As part of the broader problem, I will fit this function for different $T$ values to optimise chi-squared so that I might find the best $T.$

User1865345
  • 8,202
Navia
  • 1
  • F is a linear function of sin(x/T) and cos(x/T). – Lucas Gautheron Nov 15 '22 at 23:53
  • You can only use linear regression if $T$ is known. You say it's a parameter, and if you're estimating that parameter, the model is not linear in $T$. This is discussed in several posts already on site. – Glen_b Nov 16 '22 at 00:36
  • 1
    There's an example with known $T$ here: https://stats.stackexchange.com/questions/60500/how-to-find-a-good-fit-for-semi-sinusoidal-model-in-r/60504#60504 . WIth $T$ unknown, various strategies (including using nonlinear least squares) are discussed here: https://stats.stackexchange.com/questions/60994/fit-a-sinusoidal-term-to-data . – Glen_b Nov 16 '22 at 00:44

0 Answers0