Download Teaching statistics interactively with Geogebra and R

Document related concepts
no text concepts found
Transcript
Teaching statistics interactively with Geogebra and R
V. Gómez Rubio, M.J. Haro Delicado, F. Parreño Torres
Departamento de Matemáticas
Campus de Albacete
Universidad de Castilla-La Mancha
useR! 2013
Albacete, 10-12 July 2013
V. Gómez Rubio et al. (UCLM)
Geogebra and R
1 / 12
R software for statistical computing
Geogebra is a free software for dynamic geometry
Geogebra is widely used to teach Mathematics at the high school and
university levels
With Geogebra, students can create and manipulate geometrical
objects
We use R for teaching Statistics in the Degrees of Computer Science
and Industrial Engineering
How can we use a more intuitive and dynamic environment to
teach Probability and Statistics?
V. Gómez Rubio et al. (UCLM)
Geogebra and R
2 / 12
Geogebra and R
Geogebra 5.0 and the Python Window
From version 5.0, Geogebra will be able to run small Python scripts
Gemoetric objects can be created and manipulated using small pieces
of code
Geogebra uses Jython, a Java implementation in Python
Rserve package
R package to make a server out of R
Hence, it is possible to send commands to R from another software
and get the results back
Furthermore, Rserve provide an API in Java
THis API can be easily imported using Geogebra’s Python
Window
And it can be included in Geogebra because it is written in JAVA!!
V. Gómez Rubio et al. (UCLM)
Geogebra and R
3 / 12
Geogebra with R and Rserve
V. Gómez Rubio et al. (UCLM)
Geogebra and R
4 / 12
Example 1: Sampling random points in R
#Simulamos 10 puntos al azar en R y los dibujamos en Geogebra
#desde la Ventana de Python
import sys;
sys.path.append("/home/virgil/Rservejar/Rserve.jar");
sys.path.append("/home/virgil/Rservejar/REngine.jar");
from org.rosuda.REngine.Rserve import RConnection;
R= RConnection();
#Ten random points
R.eval("set.seed(1); d<-data.frame(x=runif(10), y=runif(10))");
for i in range(1,11):
Point(R.eval(’d[%d,1]’%(i)).asDouble(),
R.eval(’d[%d,2]’ % (i)).asDouble()
);
V. Gómez Rubio et al. (UCLM)
Geogebra and R
5 / 12
Example 1: Sampling random points in R
V. Gómez Rubio et al. (UCLM)
Geogebra and R
6 / 12
Example 2: Control bands
V. Gómez Rubio et al. (UCLM)
Geogebra and R
7 / 12
Example 3: Importing maps into Geogebra
V. Gómez Rubio et al. (UCLM)
Geogebra and R
8 / 12
Example 4: Smoothing using ’lowess’
V. Gómez Rubio et al. (UCLM)
Geogebra and R
9 / 12
Example 5: Point Patterns
V. Gómez Rubio et al. (UCLM)
Geogebra and R
10 / 12
Final remarks
We have shown several examples on how Geogebra can be used to
teach Statistics
This can be used, not only for high school students, but for college
students
We have introduced a powerful link between Geogebra and R
Hence, R packages can be used from Geogebra
Howevere, R cannot access the varialbes in Geogebra (data sheets,
GUI, etc.) with this link
We are working on a connection based on rJava which provides a
better link:
Direct access to Geogebra objects
New geometric objects can be created from R
Handling geometric objects from R
V. Gómez Rubio et al. (UCLM)
Geogebra and R
11 / 12
References
Geogebra developers web site:
https://dev.geogebra.org
R software:
http://www.r-project.org
Link between Geogebra and R:
http://www.uclm.es/profesorado/vgomez/GeogebraR
V. Gómez Rubio et al. (UCLM)
Geogebra and R
12 / 12