Skip to content

Commit

Permalink
[ADD] plotting log Revenue
Browse files Browse the repository at this point in the history
  • Loading branch information
hollydinkel committed Aug 15, 2024
1 parent 369302a commit 10da15d
Show file tree
Hide file tree
Showing 26 changed files with 83 additions and 39 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains the data and analysis code to support methods in our pa

*Authors listed in alphabetical order by last name.

# Motivation
## Motivation

Enhanced access to space, climate and natural resource monitoring, space-based awareness, on-demand analytics, and data independence motivate a growing commercial EO market. An increasing number of diverse companies globally strive to establish their own competitive market niche, but often do not reach commercial viability. Existing work provides market intelligence and identifies trends in venture financing. These methods do not indicate cultural and financial mechanisms enabling the innovation required to sustain market share for incumbent players or market penetration for emerging ones.

Expand All @@ -16,6 +16,10 @@ This study measures the innovation success of selected companies worldwide based
<img src="images/total_liabilities_growth_rate.png" width="250" title="Total Liabilities Growth Rate">
</p>

<p align="center">
<img src="images/revenue_separate.png" width="500" title="Revenue">
</p>

## Dependencies

- numpy
Expand Down
Binary file modified images/acf_analysis/Assets_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Assets_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Equity_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Equity_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Liabilities_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Liabilities_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/Revenue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/asset_turnover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/financial_leverage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/fraction_constellation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gom_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/iqps_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/kleos_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/npm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/planet_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/revenue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/revenue_separate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/roe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/satellogic_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_asset_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_equity_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_liabilities_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_satellites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 45 additions & 10 deletions src/plot_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import pandas as pd

def plotGrowthRate(fig, ax, data, key, companyMetadata, company, ylabel):
ax.tick_params(axis='both', which='major', labelsize=16)
Expand Down Expand Up @@ -28,14 +29,48 @@ def plotKPIs(fig, ax, data, key, companyMetadata, company, ylabel):
plt.rcParams['legend.title_fontsize'] = '16'
return fig

def plotPredictions(fig, ax, time, prediction, companyMetadata, company):
ax.set_title(company, fontsize=16, fontweight='bold')
ax.tick_params(axis='both', which='major', labelsize=16)
ax.set_xlabel('Year', fontsize=16)
ax.set_ylabel('Revenue ($ USD)', fontsize=16)
ax.xaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.yaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
company_color = np.array(companyMetadata[company]["color"]) / 255
ax.plot(time, prediction, color=company_color, linestyle=companyMetadata[company]["style"], label=company, linewidth=10)
fig.tight_layout()
def plotPredictions(fig, ax, company, time=None, prediction=None, ground_truth=None, companyMetadata=None, plotEverything=False):
size = 22
if company != "Synspective" and not plotEverything:
company_color = np.array(companyMetadata[company]["color"]) / 255
ax.set_title(company, fontsize=16, fontweight='bold')
ax.tick_params(axis='both', which='major', labelsize=16)
ax.set_xlabel('Year', fontsize=16)
ax.set_ylabel('Revenue ($ USD)', fontsize=16)
ax.xaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.yaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.plot(time, prediction, color=company_color, linestyle="dotted", label="In-Sample Prediction", linewidth=10)
ax.plot(time, ground_truth, color=company_color, linestyle="solid", label="Ground Truth", linewidth=10)
ax.legend(ncol=2, bbox_to_anchor=(0.85, -0.15), fancybox=True, fontsize='16', frameon=True)
box = ax.get_position()
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
elif company!= "Synspective" and plotEverything:
company_color = np.array(companyMetadata[company]["color"]) / 255
ax.set_title(company, fontsize=size, fontweight='bold')
ax.tick_params(axis='both', which='major', labelsize=18)
ax.set_xlabel('Year', fontsize=size)
ax.set_ylabel('Revenue ($ USD)', fontsize=size)
ax.xaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.yaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.set_yscale('log')
ax.set_xlim([pd.to_datetime('2018-06-01'), pd.to_datetime('2024-12-31')])
ax.set_ylim([1, 10**9])
ax.plot(time, prediction, color=company_color, linestyle="dotted", linewidth=12)
ax.plot(time, ground_truth, color=company_color, linestyle="solid", linewidth=12)
elif company == "Synspective" and plotEverything:
ax.set_xticks([])
ax.set_yticks([])
ax.set_title(company, fontsize=size, fontweight='bold')
ax.text(0.5, 0.5, 'Data not available', horizontalalignment='center',
verticalalignment='center', fontsize=size, color='black',
transform=ax.transAxes)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
line1, = ax.plot([], [], color='k', linestyle="dotted", linewidth=12, label='In-Sample Prediction') # Red dotted line
line2, = ax.plot([], [], color='k', linestyle="solid", linewidth=12, label='Ground Truth Data') # Blue solid line
# Add the legend with specified labels
fig.legend([line1, line2], ['In-Sample Prediction', 'Ground Truth Data'],
loc='upper center', bbox_to_anchor=(0.5, 0.08), ncol=2, prop={'size': size})
return fig
61 changes: 33 additions & 28 deletions src/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def transformFinancialMetrics(company, filteredData):
fig15, ax15 = plt.subplots(figsize=(10, 7), dpi=300)
fig16, ax16 = plt.subplots(figsize=(10, 7), dpi=300)
fig17, ax17 = plt.subplots(figsize=(10, 7), dpi=300)
fig18, ax18 = plt.subplots(2, 3, figsize=(30, 20), dpi=300)

for i, company in enumerate(companyMetadata):
print("COMPANY: ", company)
Expand Down Expand Up @@ -169,15 +170,15 @@ def transformFinancialMetrics(company, filteredData):
inSamplePredictions = ardl_fit.predict(start=0, end=len(frame)-1)

if company == "iQPS":
plotPredictions(fig12, ax12, filteredData["Quarter"], inSamplePredictions, companyMetadata, company)
plotPredictions(fig12, ax12, company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata)
elif company == "GomSpace":
plotPredictions(fig13, ax13, filteredData["Quarter"], inSamplePredictions, companyMetadata, company)
plotPredictions(fig13, ax13, company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata)
elif company == "Kleos Space":
plotPredictions(fig14, ax14, filteredData["Quarter"], inSamplePredictions, companyMetadata, company)
plotPredictions(fig14, ax14, company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata)
elif company == "Planet Labs":
plotPredictions(fig15, ax15, filteredData["Quarter"], inSamplePredictions, companyMetadata, company)
plotPredictions(fig15, ax15, company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata)
elif company == "Satellogic":
plotPredictions(fig16, ax16, filteredData["Quarter"], inSamplePredictions, companyMetadata, company)
plotPredictions(fig16, ax16, company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata)

fig6 = plotKPIs(fig6, ax6, transformedData, "financialLeverage", companyMetadata, company, 'Financial Leverage')
fig7 = plotKPIs(fig7, ax7, transformedData, "ROE", companyMetadata, company, 'Return on Equity')
Expand All @@ -186,6 +187,9 @@ def transformFinancialMetrics(company, filteredData):
fig17 = plotKPIs(fig17, ax17, transformedData, "Revenue_USD", companyMetadata, company, 'Revenue ($USD)')
plot_acf(transformedData["Revenue_USD"], lags=3, title=company, ax = ax25[i//3, i%3], color = 'red')
plot_pacf(transformedData["Revenue_USD"], lags=2, title=company, ax = ax26[i//3, i%3], color = 'red')
plotPredictions(fig18, ax18[i//3, i%3], company, filteredData["Quarter"], inSamplePredictions, transformedData["Revenue_USD"], companyMetadata, plotEverything=True)
else:
plotPredictions(fig18, ax18[i//3, i%3], company, plotEverything=True)

plot_acf(transformedData["Total_Assets_USD"], lags=3, title=company, ax = ax1[i//3, i%3], color = 'red')
plot_pacf(transformedData["Total_Assets_USD"], lags=2, title=company, ax = ax2[i//3, i%3], color = 'red')
Expand All @@ -203,26 +207,27 @@ def transformFinancialMetrics(company, filteredData):

for fig in acf_list:
fig.tight_layout()
fig1.savefig(f"./images/acf_analysis/Assets_acf.png")
fig2.savefig(f"./images/acf_analysis/Assets_pacf.png")
fig21.savefig(f"./images/acf_analysis/Liabilities_acf.png")
fig22.savefig(f"./images/acf_analysis/Liabilities_pacf.png")
fig23.savefig(f"./images/acf_analysis/Equity_acf.png")
fig24.savefig(f"./images/acf_analysis/Equity_pacf.png")
fig25.savefig(f"./images/acf_analysis/Revenue.png")
fig26.savefig(f"./images/acf_analysis/Revenue.png")
fig3.savefig(f"./images/total_asset_growth_rate.png")
fig4.savefig(f"./images/total_liabilities_growth_rate.png")
fig5.savefig(f"./images/total_equity_growth_rate.png")
fig6.savefig(f"./images/financial_leverage.png")
fig7.savefig(f"./images/roe.png")
fig8.savefig(f"./images/npm.png")
fig9.savefig(f"./images/asset_turnover.png")
fig10.savefig(f'./images/total_satellites.png')
fig11.savefig(f'./images/fraction_constellation.png')
fig12.savefig(f'./images/iqps_isp.png')
fig13.savefig(f'./images/gom_isp.png')
fig14.savefig(f'./images/kleos_isp.png')
fig15.savefig(f'./images/planet_isp.png')
fig16.savefig(f'./images/satellogic_isp.png')
fig17.savefig(f'./images/revenue.png')
fig1.savefig(f"./images/acf_analysis/Assets_acf.png", bbox_inches='tight')
fig2.savefig(f"./images/acf_analysis/Assets_pacf.png", bbox_inches='tight')
fig21.savefig(f"./images/acf_analysis/Liabilities_acf.png", bbox_inches='tight')
fig22.savefig(f"./images/acf_analysis/Liabilities_pacf.png", bbox_inches='tight')
fig23.savefig(f"./images/acf_analysis/Equity_acf.png", bbox_inches='tight')
fig24.savefig(f"./images/acf_analysis/Equity_pacf.png", bbox_inches='tight')
fig25.savefig(f"./images/acf_analysis/Revenue.png", bbox_inches='tight')
fig26.savefig(f"./images/acf_analysis/Revenue.png", bbox_inches='tight')
fig3.savefig(f"./images/total_asset_growth_rate.png", bbox_inches='tight')
fig4.savefig(f"./images/total_liabilities_growth_rate.png", bbox_inches='tight')
fig5.savefig(f"./images/total_equity_growth_rate.png", bbox_inches='tight')
fig6.savefig(f"./images/financial_leverage.png", bbox_inches='tight')
fig7.savefig(f"./images/roe.png", bbox_inches='tight')
fig8.savefig(f"./images/npm.png", bbox_inches='tight')
fig9.savefig(f"./images/asset_turnover.png", bbox_inches='tight')
fig10.savefig(f'./images/total_satellites.png', bbox_inches='tight')
fig11.savefig(f'./images/fraction_constellation.png', bbox_inches='tight')
fig12.savefig(f'./images/iqps_isp.png', bbox_inches='tight')
fig13.savefig(f'./images/gom_isp.png', bbox_inches='tight')
fig14.savefig(f'./images/kleos_isp.png', bbox_inches='tight')
fig15.savefig(f'./images/planet_isp.png', bbox_inches='tight')
fig16.savefig(f'./images/satellogic_isp.png', bbox_inches='tight')
fig17.savefig(f'./images/revenue.png', bbox_inches='tight')
fig18.savefig(f'./images/revenue_separate.png', bbox_inches='tight')

0 comments on commit 10da15d

Please sign in to comment.