lunes, 21 de noviembre de 2011

RClimate Images, Links to Data & R Script Files

Esta es una página interesante sobre análisis de series temporales de clima con R. Encontrarán datos y los scripts con los que generaron cada gráfico.
Espero les sea útil, saludos!

RClimate Images, Links to Data & R Script Files


Climate Trends
RClimate Images, R Script and Data File Links

Return to: Climate Charts & Graphs Blog

Topic Click Image to Enlarge Links
GISS Land & Ocean Temperature Anomaly Trends

Shows monthly GISS Land & Sea Temperature Anomaly - C trend from 1880 until latest month available from NASA GISSTemp. Base period is 1951-1980.

Decadal means shown in blue steps and last monthly value highlighted in red. Decadal means show steep rise since mid 1970s.

Data

R script

GISS Land & Ocean Temperature Anomaly Map

Users can use NASA's interactive tool to make a global map of temperature anomalies on a 2x2 degree grid at this link.

Users can also download a text file of the data.

I have developed an RClimate script to map the NASA GISTemp anomaly data using readily available R mapping packages.

Data
R script

RSS Global Land & Ocean Temperature Anomaly Trends

Shows monthly satellite based RSS Land & Sea Temperature Anomaly - C from Nov., 1978 to last available month.

Annual means are shown in blue steps and last monthly value highlighted in red.

Data

R script

UAH Channel 5 Long Term and Current Month Trends

Uses R's figure inside figure capability to show both the long term anomaly trend as well as the current month daily trend.

R script includes data retrieval, conversion of wide format table to long format, calculation of monthly averages and production of 2 figures in one chart.

Data

R script

Consolidated Global Land and Ocean Temperature Anomaly Series Since 1880

Shows monthly temperature anomaly data for 5 major temperature L&O anomaly series: GISS, NOAA, Hadley, RSS and UAH. First 3 use station data, the last 2 use satellite based observations.

The CSV data file is updated monthly from source agency data files. All source agency data is downloaded so that any changes in source data will be reflected in the consolidated file.

RClimate.txt includes a series of custom functions() that I have written to facilitate LOTA download and analysis. Interested RUsers can source my RClimate functions with this link: http://processtrends.com/Files/RClimate.txt

Data

Consolidated Global Land and Ocean Temperature Anomaly Series for Selected Month Since 1880

This panel chart and table shows the monthly anomaly trends for the 5 major global temperature anomaly series and a table that shows how the selected month ranks over the entire record for each series.

Data
R Script

Year-to-data Consolidated Global Land and Ocean Temperature Anomaly Series Since 1880

This 5 panel chart and table shows the year-to-date anomaly trends for the 5 major global temperature anomaly series and a table that shows how the current year ranks over the entire record for each series.

Data
R Script
Common Baseline for 5 LOTA Series

The 5 global land-ocean temperature anomaly (LOTA) series use different baseline periods, making direct comparisons between the series more difficult than it would be if each series had the same baseline period.

This post shows how to convert the 5 major LOTA series to a common baseline. Links to on-line source data file and RClimate script are provided. Here is long term LOTA trends using a 133 month moving average and 1979-2008 baseline.

Data

R script

SST Anomaly (Monthly)

Shows monthly NOAA - NCDC monthly Sea Surface Temperature - C (SST) Anomaly trends, starting in 1880 to most current month.

Decadal means shown in blue steps and last monthly value highlighted in red.

Data

R script

Mean Sea Level Anomaly

Shows monthly global mean sea level trends of NOAA's Laboratory of Satellite Altimetry global mean sea level data. The chart shows the missions (TOPEX, Jason-1, Jason-2) by color code and highlights the latest monthly data point.

The seasonal signal has been removed and an inverted barometer has been applied. No glacial isostatic adjustment (GIA) has been made. The overall rate of increase is 2.9 mm/yr. GIA estimates are in the 0.2 - 0.5 mm/yr range.

This RClimate script requires user to download and save NetCDF file to own PC. Make sure to adjust source data file link in R script to properly locate the data file on your PC.

Data

R Script

Mean Sea Level Anomaly

Shows monthly global mean sea level trends of University of Colorado - Boulder's satellite based data. Source data has not been updated since Sept., 2009. I will resume updating when source data is updated.

Chart shows the monthly change in mean sea level in red, 60-days smoothing value in blue and overall trend in green. The overall rate of increase is 3.1 mm/yr, with a +- error band of 0.4 mm/yr.

Data
CO2 Trends - Mauna Loa

Shows monthly CO2 (ppmv). Data from 1958 to last available month.

Last monthly value highlighted in red.

Data

R script

Total Solar Irradiance (TSI)

Shows NASA Solar Radiation & Climate Experiment (SORCE) Mission Data from 2/25/03 to present. Data updated weekly.

Data

R script

Nino_34 SST Anomaly

Shows NOAA's weekly trend in Nino 3.4 SST anomalies from January, 1990 to most recent week. Data reflects week centered on Wednesdays.

Periods with negative anomalies (La Nina like conditions) are shown in blue and periods with positive anomalies (El Nino like conditions) are shown in red.

Most recent reading is highlighted in black.

Data

R script

Pacific Decadal Oscillation

Downloads and plots University of Washington, Joint Institute for the Study of Atmosphere and Ocean (JISAO) monthly Pacific Decadal Oscillation (PDO) from January, 1900 to latest available month at time script is run.

Negative PDO months are shown in light blue and positive months are shown in pink. The most recent reading is highlighted in red.

The title and legend include the latest data month.

Data

R script

Polar Amplification: 2000 to 2009

Shows NASA GISS temperature anomaly by latitude zone for 2000-2009 compared to baseline period (1951-1980).

Chart demonstrates significant Northern Hemisphere temperature anomaly increase with increasing latitudes. This means that Arctic regions are warming much more rapidly than the global mean. While the global mean temperature anomaly increased 0.6 C in 2000-2009, the Arctic region anomalies increased nearly 1.8 C.

Data

R script

Arctic Sea ice Extent: Comparison of 2010 and 2007 Trends

Retrieves JAXA daily Arctic Sea Ice Extent (SIE) csv file, plots 2007 and 2010 trends, highlights the maximum and current values for both series, calculates the decline rate for selected time periods and displays as table in plot.

R script

Data

Arctic Sea Ice Extent Daily Change Comparison: 2007 vs 2010
Arctic Sea Ice Extent by Month

Shows National Snow and Ice Data Center's (NSIDC) monthly Arctic Sea Ice extent trends in millions of square kilometers from 1979 to latest month.

Arctic sea ice extent includes areas with at least 15% sea ice concentrations.

Since sea ice extent varies seasonally, the chart shows the trend for each month. The latest month trend shown is shown in red. All months show declining sea ice extent, which is consistent with polar amplification, rising SSTA and rising global mean temperature anomaly trends.

2nd chart shows just latest month. Trend line added to display OLS trend line for monthly data.

Data

R script

NSIDC Annual Arctic Sea ice Extent Max, Min & Melt

Data

R script

Arctic Sea Ice Extent Forecast - Sept 2011

I used a quadratic regression model to fit 1980 - 2010 NSDIC September sea ice extent (SIE) data. It hen forecast the Sept., 2011 SIE with this model.

See Climate Charts & Graphs post.

Data
R script

Daily JAXA Arctic Sea Ice Extent for latest Month

Shows JAXA daily Arctic Sea Ice extent trends in millions of square kilometers from 2002 to latest month.

Arctic sea ice extent includes areas with at least 15% sea ice concentrations.

Since sea ice extent varies seasonally, the chart shows the trend for the current month for each year from 2002 to the present. The latest daily reading is shown in red for the current year and previous years.

R script

Data

Arctic Sea Ice Area Anomaly

The University of Illinois at Urbana Champaign (UIUC)'s The Cryosphere Today (link) tracks Arctic sea ice extent and area on a daily basis, They maintain a chart called of daily sea ice area anomalies extending back to 1979. They call it the Tail of the Tape. Since it is so long, it can be difficult to read (link).

I have developed a similar chart that displays in a single window so that readers can see the entire record in one glance. While the Cryoshpere Today gives more detail, I think my chart gives a better overview of the long term SIA anomaly trends.

Data
Temperature Sounding Profile

Here's an RClimate based plot of Washington DC area atmospheric temperature soundings that will be updated daily.

R Script
Arctic Oscillation

NOAA updates monthly Arctic Oscillation Index (link).

Recent AO data for past 120 days.

Data
R script

Data
Climate Oscillations and GISS Anomalies

This series constructs monthly file of GISS anomaly, PDO,AMO and ENSO data series and performs detailed analysis of the consolidated data file.

R script to develop consolidated file of monthly GISS, PDO, AMO, ENSO data series

R script

Data

Data

R script

viernes, 11 de noviembre de 2011

Una charla sobre la estadística espacial... UAL, 10/11/2012.

Esta es la presentación de una charla sobre modelos espacio-temporales aplicados en ecología, que he dado el 10 de noviembre en la UAL en el Máster en Evaluación del Cambio Global. El objetivo fue hablar de la importancia de considerar las escalas espacial y temporal en los análisis de datos de ecología, haciendo énfasis en la consideración de estructuras de dependencia o autocorrelación. Dada la amplia variedad de técnicas estadísticas para este tipo de análisis, la presentación pretendió dar una breve guía donde resumir las principales técnicas disponibles según el tipo de datos que estemos analizando. Se trabajó con ejemplos ecológicos aplicados en el software R, utilizando varias librerías.
A pesar de haber sido una charla demasiado ambiciosa, espero que haya servido al menos para promover nuevas ideas sobre cómo abordar los datos espaciales y cómo hacerse nuevas preguntas desde un planteo formal y riguroso.
Aquí les dejo el material para cualquier curioso, si desean más ejemplos de aplicación en R, basta con mirar en el blog o enviarme un mail con preguntas (que espero poder responder).
Saludos!


presentacion

viernes, 7 de octubre de 2011

III Jornadas de Usuarios de R

III Jornadas de Usuarios de R

Logo de las jornadas

III Jornadas de Usuarios de R
17 y 18 de Noviembre de 2011
Escuela de Organización Industrial, Madrid


Revolution Analytics logologo eoilogo nestoria
Springer logologo CUPlogo OUPlogo crc

Sobre las Jornadas

Las III Jornadas de Usuarios de R tendrán lugar en la Escuela de Organización Industrial, en Madrid, los días 17 y 18 de noviembre de 2011.

Muy recomendable: Talleres de Aplicaciones Libres en la ETSIIT (2011-2012) – Oficina de Software Libre de la Universidad de Granada

Talleres de Aplicaciones Libres en la ETSIIT (2011-2012) – Oficina de Software Libre de la Universidad de Granada

Talleres de Aplicaciones Libres en la ETSIIT (2011-2012)

Tras las experiencias de años pasados, este año especializaremos los cursos a temas determinados, dando además clases más avanzadas para atraer a más gente. En concreto, empezaremos a explicar aplicaciones y uso de Linux en escritorio en clases básicas pero también avanzadas.

Clases

Total horas

25 horas

Créditos de libre configuración

1 crédito (solicitado; el año pasado se concedió en las carreras de Informática 1 y 0.8 en Telecomunicaciones)

Matriculación

Gratuita en este formulario; no se envía confirmación de la inscripción, pero sí un recordatorio unos días antes del comienzo. Hay un total de 40 plazas (la capacidad del aula).

Dirección

Juan Julián Merelo Guervós, director de la Oficina de Software Libre

Lugar de realización

Aula 1.3 a las 11 de la mañana.

Control de asistencia

La OSL solicitará registro previo para las actividades, y controlará la asistencia en cada una de ellas.

viernes, 30 de septiembre de 2011

RTextTools: a machine learning library for text classification - Blog

RTextTools: a machine learning library for text classification - Blog
Un buen aporte de All, Loren Collingwood y Timothy P. Jurka, que espero poder investigar pronto.

RTextTools bundles a host of functions for performing supervised learning on your data, but what about other methods like latent Dirichlet allocation? With some help from the topicmodels package, we can get started with LDA in just five steps. Text in green can be executed within R.

Step 1: Install RTextTools + topicmodels
We begin by installing and loading RTextTools and the topicmodels package into our R workspace.

install.packages(c("RTextTools","topicmodels"))
library(RTextTools)
library(topicmodels)

Step 2: Load the Data
In this example, we will be using the bundled NYTimes dataset compiled by Amber E. Boydstun. This dataset contains headlines from front-page NYTimes articles. We will take a random sample of 1000 articles for the purposes of this tutorial.

data <- read_data(system.file("data/NYTimes.csv.gz",package="RTextTools"), type="csv")
data <- data[sample(1:3100,size=1000,replace=FALSE),]

Step 3: Create a DocumentTermMatrix
Using the create_matrix() function in RTextTools, we'll create a DocumentTermMatrix for use in the LDA() function from package topicmodels. Our text data consists of the Title and Subject columns of the NYTimes data. We will be removing numbers, stemming words, and weighting the DocumentTermMatrix by term frequency.

matrix <- create_matrix(cbind(data$Title,data$Subject), language="english", removeNumbers=TRUE, stemWords=TRUE, weighting=weightTf)

Step 4: Perform Latent Dirichlet Allocation
First we want to determine the number of topics in our data. In the case of the NYTimes dataset, the data have already been classified as a training set for supervised learning algorithms. Therefore, we can use the unique()function to determine the number of unique topic categories (k) in our data. Next, we use our matrix and this k value to generate the LDA model.

k <- length(unique(data$Topic.Code))
lda <- LDA(matrix, k)

Step 5: View the Results
Last, we can view the results by most likely term per topic, or most likely topic per document.

terms(lda)
Topic 1 "campaign" Topic 2 "kill" Topic 3 "elect" Topic 4 "china" Topic 5 "govern" Topic 6 "fight" Topic 7 "leader" Topic 8 "york" Topic 9 "isra" Topic 10 "win" Topic 11 "report" Topic 12 "plan"
Topic 13 "republican"Topic 14 "aid" Topic 15 "set" Topic 16 "clinton" Topic 17 "nation" Topic 18 "hous"
Topic 19 "iraq" Topic 20 "bush" Topic 21 "citi" Topic 22 "rais" Topic 23 "overview" Topic 24 "money"
Topic 25 "basebal" Topic 26 "court" Topic 27 "war"

topics(lda)
Output too long to display here. Try it out for yourself to see what it looks like!

Recursos disponibles de la última conferencia de usuarios de R (useR! 2011)

useR! 2011, resources for tutorials