PINE LIBRARY
CyberRegimeLib

CyberRegimeLib - online sssm
GaussianRegime parameter/state UDT
PosteriorHistory ring-buffer UDT
Gaussian cloning and prior-stat capping
Online EM accumulation and M-step
Hamilton forward filtering
One-step smoothing
Fixed-horizon Kim smoothing
Active-state hysteresis
Library "CyberRegimeLib"
f_regime_new(dimensions)
Parameters:
dimensions (int)
method clone(source)
Namespace types: GaussianRegime
Parameters:
source (GaussianRegime)
f_clone_regimes(source)
Parameters:
source (array<GaussianRegime>)
f_n_eff_at(regimes, index)
Parameters:
regimes (array<GaussianRegime>)
index (int)
f_cap_prior_stats(regimes, total_cap)
Parameters:
regimes (array<GaussianRegime>)
total_cap (float)
method initialize_stats(regime, regime_count, active_dims)
Namespace types: GaussianRegime
Parameters:
regime (GaussianRegime)
regime_count (int)
active_dims (array<bool>)
f_accumulate_stats(regimes, responsibilities, observation, lambda_eff, admission_weight, count, prior_weighted, full_cov_dims)
Parameters:
regimes (array<GaussianRegime>)
responsibilities (array<float>)
observation (array<float>)
lambda_eff (float)
admission_weight (float)
count (int)
prior_weighted (bool)
full_cov_dims (int)
method mstep(regime, active_dims, ridge_main, ridge_aux, shrinkage, min_n_eff, anchor)
Namespace types: GaussianRegime
Parameters:
regime (GaussianRegime)
active_dims (array<bool>)
ridge_main (float)
ridge_aux (float)
shrinkage (float)
min_n_eff (float)
anchor (float)
f_hamilton_step(transition, filtered, log_likelihoods, count)
Parameters:
transition (matrix<float>)
filtered (array<float>)
log_likelihoods (array<float>)
count (int)
f_history_new(capacity, state_count)
Parameters:
capacity (int)
state_count (int)
method push(history, filtered, predicted)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
filtered (array<float>)
predicted (array<float>)
method smooth_one(history, transition, fallback_index, fallback_probability)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
transition (matrix<float>)
fallback_index (int)
fallback_probability (float)
method smooth_fixed(history, transition, horizon)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
transition (matrix<float>)
horizon (int)
f_hysteresis_state(current, active_since, candidate, best, second, minimum_margin, minimum_bars, current_bar)
Parameters:
current (int)
active_since (int)
candidate (int)
best (float)
second (float)
minimum_margin (float)
minimum_bars (int)
current_bar (int)
GaussianRegime
Fields:
mu (array<float>)
mu_seed (array<float>)
Sigma (matrix<float>)
Sigma_inv (matrix<float>)
F (matrix<float>)
Q_diag (array<float>)
prior (series float)
n_eff (series float)
sum_x (array<float>)
sum_xx (matrix<float>)
PosteriorHistory
Fields:
filtered_flat (array<float>)
predicted_flat (array<float>)
write_idx (series int)
count (series int)
capacity (series int)
state_count (series int)
GaussianRegime parameter/state UDT
PosteriorHistory ring-buffer UDT
Gaussian cloning and prior-stat capping
Online EM accumulation and M-step
Hamilton forward filtering
One-step smoothing
Fixed-horizon Kim smoothing
Active-state hysteresis
Library "CyberRegimeLib"
f_regime_new(dimensions)
Parameters:
dimensions (int)
method clone(source)
Namespace types: GaussianRegime
Parameters:
source (GaussianRegime)
f_clone_regimes(source)
Parameters:
source (array<GaussianRegime>)
f_n_eff_at(regimes, index)
Parameters:
regimes (array<GaussianRegime>)
index (int)
f_cap_prior_stats(regimes, total_cap)
Parameters:
regimes (array<GaussianRegime>)
total_cap (float)
method initialize_stats(regime, regime_count, active_dims)
Namespace types: GaussianRegime
Parameters:
regime (GaussianRegime)
regime_count (int)
active_dims (array<bool>)
f_accumulate_stats(regimes, responsibilities, observation, lambda_eff, admission_weight, count, prior_weighted, full_cov_dims)
Parameters:
regimes (array<GaussianRegime>)
responsibilities (array<float>)
observation (array<float>)
lambda_eff (float)
admission_weight (float)
count (int)
prior_weighted (bool)
full_cov_dims (int)
method mstep(regime, active_dims, ridge_main, ridge_aux, shrinkage, min_n_eff, anchor)
Namespace types: GaussianRegime
Parameters:
regime (GaussianRegime)
active_dims (array<bool>)
ridge_main (float)
ridge_aux (float)
shrinkage (float)
min_n_eff (float)
anchor (float)
f_hamilton_step(transition, filtered, log_likelihoods, count)
Parameters:
transition (matrix<float>)
filtered (array<float>)
log_likelihoods (array<float>)
count (int)
f_history_new(capacity, state_count)
Parameters:
capacity (int)
state_count (int)
method push(history, filtered, predicted)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
filtered (array<float>)
predicted (array<float>)
method smooth_one(history, transition, fallback_index, fallback_probability)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
transition (matrix<float>)
fallback_index (int)
fallback_probability (float)
method smooth_fixed(history, transition, horizon)
Namespace types: PosteriorHistory
Parameters:
history (PosteriorHistory)
transition (matrix<float>)
horizon (int)
f_hysteresis_state(current, active_since, candidate, best, second, minimum_margin, minimum_bars, current_bar)
Parameters:
current (int)
active_since (int)
candidate (int)
best (float)
second (float)
minimum_margin (float)
minimum_bars (int)
current_bar (int)
GaussianRegime
Fields:
mu (array<float>)
mu_seed (array<float>)
Sigma (matrix<float>)
Sigma_inv (matrix<float>)
F (matrix<float>)
Q_diag (array<float>)
prior (series float)
n_eff (series float)
sum_x (array<float>)
sum_xx (matrix<float>)
PosteriorHistory
Fields:
filtered_flat (array<float>)
predicted_flat (array<float>)
write_idx (series int)
count (series int)
capacity (series int)
state_count (series int)
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。