0
$\begingroup$

Im a newbie to the statistic, so appreciate someone's help.

My requirement is to fit the below mentioend data for the Exponential and power regression models. and my Formulas are

Exponential - non linear - y~a*exp(r*x)

SLx <- read_csv(choose.files())
SLx <- data.frame(Day = index(SLx ), SLx , row.names = NULL)
ggplot(Sri_Lanka, aes(x = Day,y = No_of_patients))+ 
  geom_point() + 
  stat_smooth(method = 'nls', formula = 'y~exp(r*x)', method.args=list (start = list(r=0.1)), se=FALSE) 

power -  Non-Linear - y~a*x^b

SLx <- read_csv(choose.files())
SLx <- data.frame(Day = index(SLx ), SLx , row.names = NULL)
ggplot(SLx ,aes(x = Day,y = No_of_patients)) +  geom_point() +  stat_smooth(method = 'nls', formula = 'y~a*x^b', method.args = list(start= c(a = 1,b=1)),se=FALSE) 

I want to know that, how to fit the data on the line, removing which data ? My current plot is as below enter image description here enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

You can use some engineered features to fit your model well with minimal loss. By looking at the data points that you provided sinusoidal feature can be a good choice. Look at the below picture sinusoidal wave can fit the dataset with very little loss.

enter image description here

Hope this helps!

$\endgroup$
1
  • $\begingroup$ Yes. Its been really helpful Thank you $\endgroup$
    – Udk
    May 3, 2020 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.