From c3e11f498e6622871845522848894b2a1d7ddfea Mon Sep 17 00:00:00 2001 From: sheriff4000 Date: Tue, 4 Jun 2024 18:59:36 +0100 Subject: [PATCH] format --- src/Backtest/forecast/Combine.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Backtest/forecast/Combine.jl b/src/Backtest/forecast/Combine.jl index 969e238..ce13c9e 100644 --- a/src/Backtest/forecast/Combine.jl +++ b/src/Backtest/forecast/Combine.jl @@ -4,8 +4,8 @@ module Combine This struct represents a forecaster that can be combined with others """ struct Forecaster - forecastFunction::Function - params::Vector{Real} + forecastFunction::Function + params::Vector{Real} end """ @@ -20,14 +20,14 @@ Returns: - combinedForecast::Vector{Real}: The combined forecast """ function combineForecasts( - forecasters::Vector{Tuple{Forecaster, Real}}, data::Vector{Real}; F::Int = 1, + forecasters::Vector{Tuple{Forecaster,Real}}, data::Vector{Real}; F::Int=1 ) - combinedForecast = zeros(F) - for (forecaster, weight) in forecasters - forecast = forecaster.forecastFunction(data, forecaster.params...; F = F) - combinedForecast += forecast .* weight - end - return combinedForecast + combinedForecast = zeros(F) + for (forecaster, weight) in forecasters + forecast = forecaster.forecastFunction(data, forecaster.params...; F=F) + combinedForecast += forecast .* weight + end + return combinedForecast end end