PAPASO (OP)
Newbie
Offline
Activity: 41
Merit: 0
|
 |
May 11, 2025, 01:22:18 AM Last edit: May 12, 2025, 10:59:49 AM by hilariousandco |
|
# MSE < 1e-7, r = 1~8
import numpy as np import matplotlib.pyplot as plt
# (k, x_Q, y_Q) k_values = np.array([3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80]) x_Q = np.linspace(0.5, 2.0, 12) y_Q = np.linspace(1.0, 3.0, 12) xy = x_Q + y_Q
# Hecke a_p a_p = np.array([1.0, -1.0, 0.0, 2.0, -2.0, 1.0, -1.0, 3.0, -3.0, 2.0, 0.0, -2.0])
# (r=1~8) X_parts = [] for i in range(len(a_p)): for r in range(1, 9): X_parts.append(a_p[i] * (xy ** r)) X = np.column_stack(X_parts)
# coeffs, _, _, _ = np.linalg.lstsq(X, k_values, rcond=None) k_pred = X @ coeffs
# mse = np.mean((k_pred - k_values)**2) max_err = np.max(np.abs(k_pred - k_values)) mean_err = np.mean(np.abs(k_pred - k_values))
# print("\nSpectral Scalar k Regression (Enhanced Precision)") print("="*60) print(f"MSE: {mse:.6e}") print(f"Max Error: {max_err:.6f}") print(f"Mean Error: {mean_err:.6f}") print(f"k (true): {k_values.tolist()}") print(f"k (predicted): {np.round(k_pred, 6).tolist()}") print(f"First 6 Coeffs: {np.round(coeffs[:6], 6).tolist()}")
# plt.figure(figsize=(8, 5)) plt.plot(k_values, k_values, 'k--', label='Ideal (k=k)') plt.plot(k_values, k_pred, 'o-', label='Predicted k') plt.xlabel("True k") plt.ylabel("Predicted k") plt.title("High-Precision Spectral Fit: Hecke a_p → Scalar k (r=1~8)") plt.grid(True) plt.legend() plt.tight_layout() plt.show()
Spectral Scalar k Regression (Enhanced Precision) ============================================================ MSE: 1.421189e-07 Max Error: 0.000720 Mean Error: 0.000333 k (true): [3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80] k (predicted): [2.999897, 5.00046, 7.99928, 12.000251, 17.000455, 22.999738, 29.999608, 38.00027, 47.00034, 56.999517, 68.000221, 79.999964] First 6 Coeffs: [0.268941, -0.527246, 0.449601, -0.18748, 0.048858, -0.007781] 2025-05-10 17:59:36.576 Python[37043:21895956] +[IMKClient subclass]: chose IMKClient_Modern 2025-05-10 17:59:36.577 Python[37043:21895956] +[IMKInputSession subclass]: chose IMKInputSession_Modern https://zenodo.org/records/15379287
|
|
|
|
|
PAPASO (OP)
Newbie
Offline
Activity: 41
Merit: 0
|
 |
May 11, 2025, 02:14:12 AM |
|
# Re-execute full model after reset: multivariable regression using (x_Q, a, b) and a_p import numpy as np import matplotlib.pyplot as plt
# Simulated ECC data n_samples = 12 k_values = np.array([3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80]) x_Q = np.linspace(0.5, 2.0, n_samples) y_Q = np.linspace(1.0, 3.0, n_samples) a_curve = np.linspace(1, 3, n_samples) b_curve = np.linspace(-1, 2, n_samples) xy = x_Q + y_Q
# Hecke coefficients from ψ(t) a_p = np.array([1.0, -1.0, 0.0, 2.0, -2.0, 1.0, -1.0, 3.0, -3.0, 2.0, 0.0, -2.0]) P = len(a_p)
# Build multivariable feature matrix X_parts = [] for i in range(P): for r in range(1, 6): X_parts.append(a_p * (xy ** r)) X_parts.append(a_p * (a_curve ** r)) X_parts.append(a_p * (b_curve ** r)) X = np.column_stack(X_parts)
# Least squares regression coeffs, _, _, _ = np.linalg.lstsq(X, k_values, rcond=None) k_pred = X @ coeffs
# Error metrics mse = np.mean((k_pred - k_values) ** 2) max_err = np.max(np.abs(k_pred - k_values)) mean_err = np.mean(np.abs(k_pred - k_values))
# Output print("\nMultivariable Spectral Regression (k from ψ(t), x_Q, a, b)") print("=" * 65) print(f"MSE: {mse:.6e}") print(f"Max Error: {max_err:.6f}") print(f"Mean Error: {mean_err:.6f}") print(f"k (true): {k_values.tolist()}") print(f"k (predicted): {np.round(k_pred, 6).tolist()}") print(f"First 6 Coeffs: {np.round(coeffs[:6], 6).tolist()}")
# Visualization plt.figure(figsize=(8, 5)) plt.plot(k_values, k_values, 'k--', label='Ideal') plt.plot(k_values, k_pred, 'o-', label='Predicted') plt.xlabel("True k") plt.ylabel("Predicted k") plt.title("Spectral Fit: Multivariable Hecke Model (k ≈ ψ(x,a,b))") plt.grid(True) plt.legend() plt.tight_layout() plt.show()
Multivariable Spectral Regression (k from ψ(t), x_Q, a, b) ================================================================= MSE: 1.142697e-25 Max Error: 0.000000 Mean Error: 0.000000 k (true): [3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80] k (predicted): [3.0, 5.0, 8.0, 12.0, 17.0, 23.0, 30.0, 38.0, 47.0, 57.0, 68.0, 80.0] First 6 Coeffs: [0.000527, 0.00011, 0.003505, 0.006097, 0.00205, -0.004563] 2025-05-10 19:10:55.795 Python[37714:21939219] +[IMKClient subclass]: chose IMKClient_Modern 2025-05-10 19:10:55.795 Python[37714:21939219] +[IMKInputSession subclass]: chose IMKInputSession_Modern
|
|
|
|
|
PAPASO (OP)
Newbie
Offline
Activity: 41
Merit: 0
|
 |
May 11, 2025, 02:35:22 AM |
|
# MSE < 1e-7
import numpy as np import matplotlib.pyplot as plt
# Step 1: (n=1000) n_samples = 1000 k_values = np.linspace(1e3, 1e6, n_samples) # 更大 k 量级 x_Q = np.linspace(0.5, 2.0, n_samples) y_Q = np.linspace(1.0, 3.0, n_samples) a_curve = np.linspace(1, 3, n_samples) b_curve = np.linspace(-1, 2, n_samples) xy = x_Q + y_Q
# Hecke a_p = np.array([1.0, -1.0, 0.0, 2.0, -2.0, 1.0, -1.0, 3.0, -3.0, 2.0, 0.0, -2.0]) P = len(a_p)
# Step 2: X(r = 1~5) X_parts = [] for i in range(P): for r in range(1, 6): X_parts.append(a_p * (xy ** r)) X_parts.append(a_p * (a_curve ** r)) X_parts.append(a_p * (b_curve ** r)) X = np.column_stack(X_parts)
# Step 3: coeffs, _, _, _ = np.linalg.lstsq(X, k_values, rcond=None) k_pred = X @ coeffs
# Step 4: mse = np.mean((k_pred - k_values) ** 2) max_err = np.max(np.abs(k_pred - k_values)) mean_err = np.mean(np.abs(k_pred - k_values))
# print("\nMultivariable Spectral Regression (n = 1000)") print("=" * 65) print(f"MSE: {mse:.6e}") print(f"Max Error: {max_err:.6f}") print(f"Mean Error: {mean_err:.6f}") print(f"First 5 k (true): {np.round(k_values[:5], 3).tolist()}") print(f"First 5 k (predicted):{np.round(k_pred[:5], 3).tolist()}")
# plt.figure(figsize=(8, 5)) plt.plot(k_values[:100], k_values[:100], 'k--', label='Ideal') plt.plot(k_values[:100], k_pred[:100], 'o-', label='Predicted') plt.xlabel("True k") plt.ylabel("Predicted k") plt.title("Spectral Regression: Hecke a_p → Scalar k (n = 1000)") plt.grid(True) plt.legend() plt.tight_layout() plt.show()
Multivariable Spectral Regression (n = 1000) ================================================================= MSE: 3.990343e-16 Max Error: 0.000000 Mean Error: 0.000000 First 5 k (true): [1000.0, 2000.0, 3000.0, 4000.0, 5000.0] First 5 k (predicted):[1000.0, 2000.0, 3000.0, 4000.0, 5000.0] 2025-05-10 19:29:44.285 Python[37892:21950858] +[IMKClient subclass]: chose IMKClient_Modern 2025-05-10 19:29:44.285 Python[37892:21950858] +[IMKInputSession subclass]: chose IMKInputSession_Modern
|
|
|
|
|
PAPASO (OP)
Newbie
Offline
Activity: 41
Merit: 0
|
 |
May 11, 2025, 02:43:32 AM |
|
# n = 10000
import numpy as np import matplotlib.pyplot as plt
# Step 1: n_samples = 10000 k_values = np.linspace(1e3, 1e6, n_samples) x_Q = np.linspace(0.5, 2.0, n_samples) y_Q = np.linspace(1.0, 3.0, n_samples) a_curve = np.linspace(1, 3, n_samples) b_curve = np.linspace(-1, 2, n_samples) xy = x_Q + y_Q
# Hecke a_p = np.array([1.0, -1.0, 0.0, 2.0, -2.0, 1.0, -1.0, 3.0, -3.0, 2.0, 0.0, -2.0]) P = len(a_p)
# Step 2: X_parts = [] for i in range(P): for r in range(1, 6): X_parts.append(a_p * (xy ** r)) X_parts.append(a_p * (a_curve ** r)) X_parts.append(a_p * (b_curve ** r)) X = np.column_stack(X_parts)
# Step 3: coeffs, _, _, _ = np.linalg.lstsq(X, k_values, rcond=None) k_pred = X @ coeffs
# Step 4: mse = np.mean((k_pred - k_values) ** 2) max_err = np.max(np.abs(k_pred - k_values)) mean_err = np.mean(np.abs(k_pred - k_values))
# print("\nMultivariable Spectral Regression (n = 10000)") print("=" * 70) print(f"MSE: {mse:.6e}") print(f"Max Error: {max_err:.6f}") print(f"Mean Error: {mean_err:.6f}") print(f"First 5 k (true): {np.round(k_values[:5], 3).tolist()}") print(f"First 5 k (predicted):{np.round(k_pred[:5], 3).tolist()}")
# plt.figure(figsize=(8, 5)) plt.plot(k_values[:100], k_values[:100], 'k--', label='Ideal') plt.plot(k_values[:100], k_pred[:100], 'o-', label='Predicted') plt.xlabel("True k") plt.ylabel("Predicted k") plt.title("Multivariable Spectral Fit: Hecke a_p → Scalar k (n = 10000)") plt.grid(True) plt.legend() plt.tight_layout() plt.show()
Multivariable Spectral Regression (n = 10000) ====================================================================== MSE: 3.320705e-16 Max Error: 0.000000 Mean Error: 0.000000 First 5 k (true): [1000.0, 1099.91, 1199.82, 1299.73, 1399.64] First 5 k (predicted):[1000.0, 1099.91, 1199.82, 1299.73, 1399.64] 2025-05-10 19:40:21.196 Python[38006:21957039] +[IMKClient subclass]: chose IMKClient_Modern 2025-05-10 19:40:21.196 Python[38006:21957039] +[IMKInputSession subclass]: chose IMKInputSession_Modern
|
|
|
|
|
BADecker
Legendary
Offline
Activity: 4480
Merit: 1418
|
 |
May 11, 2025, 12:57:26 PM |
|
The point is that a whole system of encrypted wallets should be developed. This would mean that not only would people be able to trade P2P with Bitcoin, they would be able to trade P2P with wallets... something like double encryption squared. A new wallet system could take all the info in the OP posts into account, and make the system stronger than ever. 
|
|
|
|
|