Skip to content

Commit

Permalink
Merge pull request #38 from fipelle/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
fipelle authored Jul 17, 2022
2 parents e908d02 + 20edac5 commit fcedd34
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "MessyTimeSeries"
uuid = "2a88db5c-15f1-4b3e-a070-d1159e8d76cc"
version = "0.2.2"
version = "0.2.3"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 1 addition & 1 deletion src/MessyTimeSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module MessyTimeSeries
# Export methods
export check_bounds, nan_to_missing!, error_info, verb_message, interpolate_series, forward_backwards_rw_interpolation, centred_moving_average,
soft_thresholding, solve_discrete_lyapunov, isconverged, trimmed_mean, sum_skipmissing, mean_skipmissing, std_skipmissing, is_vector_in_matrix,
demean, standardise, lag, companion_form, no_combinations, rand_without_replacement, get_bounded_log, get_unbounded_log, get_bounded_logit, get_unbounded_logit;
demean, standardise, diff2, diff_or_diff2, lag, companion_form, no_combinations, rand_without_replacement, get_bounded_log, get_unbounded_log, get_bounded_logit, get_unbounded_logit;

# Export functions
export kfilter!, kfilter_full_sample, kfilter_full_sample!, kforecast, ksmoother, fmin_uc_models, arima, varima, forecast,
Expand Down
20 changes: 20 additions & 0 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,26 @@ standardise(X::FloatMatrix) = (X .- mean(X,dims=2))./std(X,dims=2);
standardise(X::JVector{Float64}) = (X .- mean_skipmissing(X))./std_skipmissing(X);
standardise(X::JMatrix{Float64}) = (X .- mean_skipmissing(X))./std_skipmissing(X);

"""
diff2(A::AbstractArray, dims::Integer)
Return double-differenced data.
"""
diff2(A::AbstractArray; dims::Integer) = diff(diff(A, dims=dims), dims=dims);

"""
diff_or_diff2(A::AbstractArray, dims::Integer, use_diff::Bool)
Use either diff or diff2 depending on the value taken by `use_diff`.
"""
function diff_or_diff2(A::AbstractArray, dims::Integer, use_diff::Bool)
if use_diff
return diff(A, dims=dims);
else
return diff2(A, dims=dims);
end
end

"""
interpolate_series(X::JMatrix{Float64}, n::Int64, T::Int64)
Expand Down

0 comments on commit fcedd34

Please # to comment.