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 הזה כספרייה בקוד פתוח, כך שמתכנתים אחרים בקהילתנו יעשו שימוש חוזר. כל הכבוד למחבר! ניתן להשתמש בספרייה הזו באופן פרטי או בומים בקוד פתוח, אך השימוש בחוזר בקוד הזה בפרסומים כפוף ל-כללי הבית.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
ספריית Pine
ברוח האמיתית של TradingView, המחבר לפרסם את הקוד של Pine הזה כספרייה בקוד פתוח, כך שמתכנתים אחרים בקהילתנו יעשו שימוש חוזר. כל הכבוד למחבר! ניתן להשתמש בספרייה הזו באופן פרטי או בומים בקוד פתוח, אך השימוש בחוזר בקוד הזה בפרסומים כפוף ל-כללי הבית.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.