Data Interview Qs - Stationary distribution of AMZN stock

InterviewQs

Stationary distribution of AMZN stock

Python Data Analysis Pandas Markov Chain Stochastic Processes Modeling

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

You can use Markov Chains and stationary (steady-state) distributions to understand a system's tendencies and forecast the likelihood of a given event. Suppose you are trying to understand the tendencies of Amazon's stock (ticker AMZN). Using the daily stock data, build a simple Markov Chain and calculate the steady-state distribution.

You will want to think through the following when drafing your solution:

  • Define the Markov Chain's events (e.g. open price on day X is higher than open price on day Y)
  • Based on the event, you will need to calculate the probability of each event
  • Calculate the steady-state distribution, you can do this by using linear algebra or creating a simulation

To help get you started, the code below installs yfinance to your Colab runtime and loads in the historical stock data. You can also make a copy of this Google Colab notebook to get started!

    

#import yahoo finance

!pip install yfinance

#import packages

import logging

import sys

import pandas as pd

import datetime

from time import sleep, strftime, time

import math

import yfinance as yf

#get dataframe -- the timeframe you analyze is up to you!

data = yf.download("AMZN", start="2020-01-02", end="2020-06-01").reset_index()


Solution will be written in Python for premium users.



 

You’ve accumulated 322 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Total revenue by location

Wednesday, July 20, 2022

SQL, Database Querying, Joining Tables, InterviewQs Total revenue by location SQL Database Querying Joining Tables Forward this email to a friend or colleague and challenge them to solve it. Hi,

Cost per customer acquisition

Monday, July 18, 2022

Python, CDF, PDF, Data Analysis, Pandas, Data Manipulation, External Dataset, InterviewQs Cost per customer acquisition Python CDF PDF Data Analysis Pandas Data Manipulation External Dataset Forward

Clock angle problem

Friday, July 15, 2022

Python, Algorithms, Data Structures, Arrays, InterviewQs Clock angle problem Python Algorithms Data Structures Arrays Forward this email to a friend or colleague and challenge them to solve it. Hi,

Efficacy of a classifier

Thursday, July 14, 2022

Statistics, Machine Learning, ROC Curve, InterviewQs Efficacy of a classifier Statistics Machine Learning ROC Curve Forward this email to a friend or colleague and challenge them to solve it. Hi,

Tree structures in SQL

Monday, July 11, 2022

SQL, Database Querying, Self-join, InterviewQs Tree structures in SQL SQL Database Querying Self-join Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose you have a

You Might Also Like

Stripe changes its … stripes

Wednesday, April 24, 2024

TikTok on the president's docket and Nvidia acquires Run:ai View this email online in your browser By Christine Hall Wednesday, April 24, 2024 Good afternoon, and welcome to TechCrunch PM! Today

💪 You Can Use Copilot AI as a Personal Trainer — Why Your Laptop Needs a Docking Station

Wednesday, April 24, 2024

Also: Here's How to Make Your Apple ID Recoverable, and More! How-To Geek Logo April 24, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to

JSK Daily for Apr 24, 2024

Wednesday, April 24, 2024

JSK Daily for Apr 24, 2024 View this email in your browser A community curated daily e-mail of JavaScript news JSK Weekly - 24th April, 2024 React 19 has introduced many great functionalities and

Daily Coding Problem: Problem #1422 [Hard]

Wednesday, April 24, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Airbnb. Given a list of integers, write a function that returns the largest sum of non-

Charted | Artificial Intelligence Patents, by Country 🤖

Wednesday, April 24, 2024

This visualization shows which countries have been granted the most AI patents each year, from 2012 to 2022. View Online | Subscribe Presented by: New on VC+: Our Visual Briefing on the IMF's World

Save your seat: 1Password’s 2024 Security report insights webinar

Wednesday, April 24, 2024

Join us April 25th. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Top Tech Deals 📱 LG Flex TV, Google Pixel 7, DJI Mini 3, and More

Wednesday, April 24, 2024

Get yourself a discounted DJI drone, save on the Pixel 7, or score some PC and phone accessories. How-To Geek Logo April 24, 2024 Top Tech Deals: LG Flex TV, Google Pixel 7, DJI Mini 3, and More Find

The Protest Song Wakes Up 🎙️

Wednesday, April 24, 2024

Is this song the future of musical protest? Here's a version for your browser. Hunting for the end of the long tail • April 24, 2024 The Protest Song Wakes Up A buzzy protest song about the

JSK Weekly - 24th April, 2024

Wednesday, April 24, 2024

React 19 has introduced many great functionalities and features, among which the useOptimistic hook stands out. The useOptimistic hook offers a seamless way to manage UI states during asynchronous

The clock’s ticking for TikTok

Wednesday, April 24, 2024

The US Senate has passed a bill that would ban TikTok if its US business is not divested by Bytedance View this email online in your browser By Alex Wilhelm Wednesday, April 24, 2024 Good morning, and