-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from LAMPSPUC/add_simulation
add simulation feature
- Loading branch information
Showing
13 changed files
with
197 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ authors = ["andreramosfc <[email protected]>"] | |
version = "0.1.2" | ||
|
||
[deps] | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
GLMNet = "8d5ece8b-de18-5317-b113-243142960cc6" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
""" | ||
get_information(T::Int64, K::Int64, ϵ::Vector{Float64}; | ||
get_information(T::Int64, K::Int64, ε::Vector{Float64}; | ||
information_criteria::String = "bic", p::Int64 = 0)::Float64 | ||
Calculates information criterion value based on the provided parameters and residuals. | ||
# Arguments | ||
- `T::Int64`: Number of observations. | ||
- `K::Int64`: Number of selected predictors. | ||
- `ϵ::Vector{Float64}`: Vector of residuals. | ||
- `ε::Vector{Float64}`: Vector of residuals. | ||
- `information_criteria::String`: Method for hyperparameter selection (default: "aic"). | ||
- `p::Int64`: Number of total predictors (default: 0). | ||
# Returns | ||
- `Float64`: Information criterion value. | ||
""" | ||
function get_information(T::Int64, K::Int64, ϵ::Vector{Float64}; information_criteria::String = "aic")::Float64 | ||
function get_information(T::Int64, K::Int64, ε::Vector{Float64}; information_criteria::String = "aic")::Float64 | ||
if information_criteria == "bic" | ||
return T*log(var(ϵ)) + K*log(T) | ||
return T*log(var(ε)) + K*log(T) | ||
elseif information_criteria == "aic" | ||
return 2*K + T*log(var(ϵ)) | ||
return 2*K + T*log(var(ε)) | ||
elseif information_criteria == "aicc" | ||
return 2*K + T*log(var(ϵ)) + ((2*K^2 +2*K)/(T - K - 1)) | ||
return 2*K + T*log(var(ε)) + ((2*K^2 +2*K)/(T - K - 1)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.