Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
4218 views

Your turn!

  1. Follow the link http://mathbits.com/MathBits/TISection/Statistics2/sinusoidal.htmlto find data for the two other cities. Type in the data and create separate scatter plots. Then find the sinusoidal model for each.

  2. Plot the function: f(x)=sin(2x-π)-2, g(x)=-3sec(πx); h(x)=tan(x-π/2) in a single graphing window from [-2π,2π]. Use different colors for each graph!

The link above does not work. I have taken your statistics and tweaked them a bit creating my own made up data just to practice the problems that you wanted me to do. Made Up City Weather data (month, max temp) : (1, 30),(2,32),(3,41),(4,56),(5,72),(6,80),(7,93),(8,91),(9,75),(10,60),(11,46),(12,32)
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "<string>", line 1 The link above does not work. I have taken your statistics and tweaked them a bit creating my own made up data just to practice the problems that you wanted me to do. ^ SyntaxError: invalid syntax
data=[(1, 30),(2,32),(3,41),(4,56),(5,72),(6,80),(7,93),(8,91),(9,75),(10,60),(11,46),(12,32)] p=scatter_plot(data) p
data=[(1, 30),(2,32),(3,41),(4,56),(5,72),(6,80),(7,93),(8,91),(9,75),(10,60),(11,46),(12,32)]#you will edit this with new data a,b,c,d=var('a,b,c,d') model(x)=a * sin(b*(x - c))+d values=find_fit(data,model,initial_guess=(25,pi/6,7,60))#you will edit the guess values based on the scatterplot params=[a,b,c,d] for i in range(4): params[i]=values[i].rhs() model(x)=params[0] * sin(params[1]*(x - params[2]))+params[3] model(x) p=scatter_plot(data,xmin=-2,xmax=14,ymin=-10,ymax=100) p+=plot(model(x),xmin=-2,xmax=14,ymin=-10,ymax=100) p
30.647381517978932*sin(0.5464751603174666*x - 2.3476132782553267) + 60.2090605597237
find_fit(data,model,initial_guess=(30,pi/6,7,60))
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/misc/lazy_import.pyx", line 354, in sage.misc.lazy_import.LazyImport.__call__ (/ext/sage/sage-8.0/src/build/cythonized/sage/misc/lazy_import.c:3559) return self.get_object()(*args, **kwds) File "/ext/sage/sage-8.0/local/lib/python2.7/site-packages/sage/numerical/optimize.py", line 685, in find_fit raise ValueError("no variables given") ValueError: no variables given