Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import streamlit as st
|
|
3 |
import numpy as np
|
4 |
import matplotlib.pyplot as plt
|
5 |
from scipy.stats import norm
|
|
|
6 |
|
7 |
# Define the functions from your code
|
8 |
def Phi(z):
|
@@ -55,11 +56,25 @@ y1, y2 = np.meshgrid(np.linspace(-3, 3, 100), np.linspace(-3, 3, 100))
|
|
55 |
pdf_values = f_BCNOLLN(y1, y2, mu1, sigma1, alpha1, beta1, mu2, sigma2, alpha2, beta2, lambd)
|
56 |
|
57 |
# Plotting
|
58 |
-
fig, ax = plt.subplots()
|
59 |
-
cp = ax.contourf(y1, y2, pdf_values, cmap='viridis')
|
60 |
-
fig.colorbar(cp)
|
61 |
-
ax.set_title('BCNOLLN PDF Contour Plot')
|
62 |
-
ax.set_xlabel('y1')
|
63 |
-
ax.set_ylabel('y2')
|
64 |
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import numpy as np
|
4 |
import matplotlib.pyplot as plt
|
5 |
from scipy.stats import norm
|
6 |
+
import plotly.graph_objects as go
|
7 |
|
8 |
# Define the functions from your code
|
9 |
def Phi(z):
|
|
|
56 |
pdf_values = f_BCNOLLN(y1, y2, mu1, sigma1, alpha1, beta1, mu2, sigma2, alpha2, beta2, lambd)
|
57 |
|
58 |
# Plotting
|
59 |
+
#fig, ax = plt.subplots()
|
60 |
+
#cp = ax.contourf(y1, y2, pdf_values, cmap='viridis')
|
61 |
+
#fig.colorbar(cp)
|
62 |
+
#ax.set_title('BCNOLLN PDF Contour Plot')
|
63 |
+
#ax.set_xlabel('y1')
|
64 |
+
#ax.set_ylabel('y2')
|
65 |
|
66 |
+
|
67 |
+
# Create a 3D contour plot with Plotly
|
68 |
+
fig = go.Figure(data=[go.Surface(z=pdf_values, x=y1, y=y2, colorscale='Viridis')])
|
69 |
+
fig.update_layout(title='BCNOLLN PDF 3D Contour Plot', autosize=True,
|
70 |
+
scene=dict(
|
71 |
+
xaxis_title='y1',
|
72 |
+
yaxis_title='y2',
|
73 |
+
zaxis_title='PDF'
|
74 |
+
))
|
75 |
+
|
76 |
+
# Display the plot in Streamlit
|
77 |
+
st.plotly_chart(fig)
|
78 |
+
|
79 |
+
|
80 |
+
#st.pyplot(fig)
|