Recently Published
Pie chart for enrollments per year
EFNEP enrollments per year
HTML
.
HTML
# Calculate mean returns
mean_returns <- colMeans(returns_date_droped_dividened2)
# Function to calculate VaR (assuming normal distribution)
VaR <- function(x, alpha = 0.05) {
mean(x) - qnorm(1 - alpha) * sd(x)
}
# Calculate VaR for each stock
VaR_values <- apply(returns_date_droped_dividened2, 2, VaR)
# Create a dataframe for plotting
plot_data <- data.frame(Stock = names(mean_returns),
Mean_Return = mean_returns,
VaR = VaR_values)
# Create the ggplot
p <- ggplot(plot_data, aes(x = Mean_Return, y = VaR, text = paste("Stock:", Stock, "<br>Return:", round(Mean_Return, 4), "<br>VaR:", round(VaR, 4)))) +
geom_point(color = 'blue', size = 3) +
labs(title = "Mean Return vs VaR for Each Stock",
x = "Mean Return",
y = "Value at Risk (VaR)") +
theme_minimal()
# Convert ggplot to plotly for interactivity
interactive_plot <- ggplotly(p, tooltip = "text")
# Display the interactive plot
interactive_plot
Accidentalidad en Barranquilla
Análisis descriptivo básico de la base de datos "Accidentalidad_en_Barranquilla.csv".
HTML
initial_portfolio <- portfolio.spec(assets = colnames(returns_date_droped_dividened2))
# Add objectives - here we minimize risk (VAR)
initial_portfolio <- add.objective(portfolio = initial_portfolio, type = "risk", name = "VaR")
initial_portfolio <- add.objective(portfolio = initial_portfolio, type = "risk-adjusted", name = "SortinoRatio")
# Add constraints - fully invested portfolio with no short sales
initial_portfolio <- add.constraint(portfolio = initial_portfolio, type = "long_only")
initial_portfolio <- add.constraint(portfolio = initial_portfolio, type = "full_investment")
initial_portfolio <- add.constraint(portfolio = initial_portfolio, type = "box", min = 0, max = 1)
# Optimize the portfolio to minimize risk
optimal_portfolio <- optimize.portfolio(R = returns_date_droped_dividened2, portfolio = initial_portfolio, optimize_method = "DEoptim")
# View the optimal weights
optimal_weights <- extractWeights(optimal_portfolio)
asset_names <- names(optimal_weights)
weights_df <- data.frame(Asset = asset_names, Weight = optimal_weights)
plot_ly(data = weights_df, x = ~Asset, y = ~Weight, type = 'bar') %>%
layout(title = "Interactive Portfolio Weights",
xaxis = list(title = "Asset"),
yaxis = list(title = "Weight"))
Geocoding Zenith Bank branches in Lagos State, Nigeria.
This report presents the geocoding of Zenith Bank branches in Lagos State, Nigeria, to enhance spatial analysis and inform business strategies.
URSN GS
Leveraging historical trials to predict Fusarium head blight resistance in wheat breeding programs