European Stock App

Assignment for Developing Data Product at Coursera.org

Aito Compton
Contract Systems Analyst

App Summary

• The app consists of visualizating the histogram, correlation matrix as well as comuting the summary of the European index.

• The data comes from the R datasets, EuStockMarkets, with daily closing prices of major European Stock Indices, such as DAX, SMI, CAC and FTSE, between 1991 and 1998.

• The code in the server side is used to compute the daily percentage returns.

• Although the data used in this analysis is limited in the sense that it does not use the actual stock data from sources, such as Yahoo! Fiannce and Goolge Finance, the code used in this product can be applied to create a robust data product.

Histogram

• By selecting the histogram checkbox, the daily return of the histogram of each index is visualized.

• The index column is used to specify which histogram for the index to draw.

• The slide bar can be used to adjust the number of observations for the histogram.

• The code to draw a histogram (not used in the actual code due to the difficulty in incorporating the codes for the input data and the slide bar:

eu<-as.data.frame(EuStockMarkets)
euMat <- sapply(eu , function(x) diff(x)/x[-length(x)])
hist(euMat[,1], col = "blue", 
            main = "The Daily Percentage Change of DAX",
            freq = F, xlab = "Percentage")

plot of chunk unnamed-chunk-1

Summary

• By selecting the "Summary" tab, the app can also compute the summary of each index contained.

• The code to compute the summary:

eu<-as.data.frame(EuStockMarkets)
euMat <- cor(sapply(eu , function(x) diff(x)/x[-length(x)]))
summary(euMat)
##       DAX              SMI              CAC              FTSE       
##  Min.   :0.6379   Min.   :0.5830   Min.   :0.6145   Min.   :0.5830  
##  1st Qu.:0.6853   1st Qu.:0.6066   1st Qu.:0.6391   1st Qu.:0.6242  
##  Median :0.7172   Median :0.6578   Median :0.6903   Median :0.6426  
##  Mean   :0.7681   Mean   :0.7246   Mean   :0.7488   Mean   :0.7171  
##  3rd Qu.:0.8000   3rd Qu.:0.7758   3rd Qu.:0.8000   3rd Qu.:0.7355  
##  Max.   :1.0000   Max.   :1.0000   Max.   :1.0000   Max.   :1.0000

Correlation Matrix

• The correlation matrix of each index is also visualized by selectingthe "Correlation" tab.

• The corrplot package from CRAN is used to draw the correlation matrix.

eu<-as.data.frame(EuStockMarkets)
euMat <- cor(sapply(eu , function(x) diff(x)/x[-length(x)]))
corrplot(euMat, method ="number")

plot of chunk unnamed-chunk-3