Portfolio optimization is the process of choosing the best portfolio among the set of all portfolios.
The naive way is to select a group of random allocations and figure out which one has the best Sharpe Ratio. This is known as the Monte Carlo Simulation where randomly a weight is assigned to each security in the portfolio and then the mean daily return and standard deviation of daily return is calculated. This helps in calculating the Sharpe Ratio for randomly selected allocations.
To know more about Sharpe Ratio, check out my previous article:
But the naive way is time taking…
A collection of financial investments is a portfolio. The financial investments can be cash, stocks, bonds, commodities and any other cash equivalents.
An investment strategy where the risk and reward are balanced of the portfolio’s assets according to the user’s investment goals, tolerance of risk and investment horizon is called portfolio allocation.
→ Import packages
The basic packages like Pandas will be imported. Along with it, the Quandl package is imported to get the data.
>>> import pandas as pd
>>> import quandl
>>> import matplotlib.pyplot as plt
>>> %matplotlib inline
→ Data
The start and end date is decided…
ARIMA which is the short form for ‘Auto-Regressive Integrated Moving Average’ is used on time series data and it gives insights on the past values like lags and forecast errors that can be used for forecasting future values.
To know more about ARIMA models, check out the article below:
The steps involved are as follows:
→ Import packages
The basic packages like NumPy and pandas…
ARIMA stands for Auto-Regressive Integrated Moving Average. It is a model used for statistical analysis of the time-series data. It helps to gain better insights into the data and predict future trends. It works very well with sales data. It is the generalization of the ARMA (autoregressive moving average) model.
A dataset is stationary if it has a constant mean, variance and covariance over time. Differencing is the process of subtracting an observation from the previous time step observation until the data is stationary…
Time series decomposition is the breaking down of the series into its trend, seasonality and noise components. It helps in understanding the time series data better while using it to analyze and forecast.
ETS stands for Error-Trend-Seasonality and is a model used for the time series decomposition. It decomposes the series into the error, trend and seasonality component. It is a univariate forecasting model used when dealing with time-series data. It focuses on trend and seasonal components. This model consists of various concepts like trend methods model, exponential smoothing and ETS decomposition.
It helps in creating a model to fit…
This article will help you understand EWMA and the implementation using Python.
EWMA stands for Exponentially Weighted Moving Average. It processes data in such a way that it gives less importance and weightage to the data which is further past in time. So it gives more weightage to the data that is recent.
It is a better version of the SMA (Simple moving average) since SMA uses small windows for calculations leading to more noise. There is a lag in the start of the plot and it never reaches the peak. It also fails to give any information about future…
In python, a very widely used library named statsmodel is used when dealing with time-series data. It is based on the statistical programming language R. This module helps in analyzing data, perform statistical functions and also create statistical models. It also has functions to plot.
So let’s dive into it!
The statsmodel is already included in the python environment file. In case a different environment like Anaconda is used then install by using the command below:
conda install statsmodels
The basic packages like NumPy and pandas to help deal with data are imported along with matplotlib to help with plottings.
…
The use of Python is tremendous and it helps in almost every use case. Through this article, I hope to introduce you to using Python in stock analysis. Right from obtaining the data of stocks to visualizing it and gaining insights, everything is explained here. The financial terms are emphasized in simpler terms along with the code for implementation to help understand the concepts better.
To facilitate the process of learning, 3 famous car company stocks are considered: Toyota, BMW and Tesla. These stocks behave differently and help distinguish and gain insights. So let’s get started!
We will start off…
A guide to help implement various Pandas functions on stock data.
When dealing with time-series data, it has a different format and usually has a DateTime index and its corresponding value. Some examples of time-series data can be stock market data, count of sunspots, or temperature reading of the atmosphere.
In this article, I will take you through the different Pandas methods that can be used with time-series stock data.
When dealing with time-series data, date and time information is a must and is always given. But the date and time information is not always in columns separated. There is…
A guide to understanding how to procure data for doing financial analysis using Python.
When you plan to work on using Python for finance, a particular form of data is needed. This data should be concerned with financial values. In this article, I will introduce two methods to get financial data using the Python language.
The first method that I have mentioned deals with getting data using Pandas-datareader. Pandas is an open-source Python library that is used for performing data analysis and is used as a manipulation tool. Check out this article mentioned below to know about Pandas in detail.
…
Self-driven woman who wishes to deliver creative and engaging ideas and solutions in the field of technology.