Skip to content

Commit

Permalink
Create markov.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Balinus authored Sep 13, 2024
1 parent a7f65c5 commit 4863651
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/markov.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function MSModel(xout, xin; k_regime=2, intercept="switching")
xout .= MarSwitching.MSModel(Float64.(xin), k_regime, intercept=intercept)
end


"""
MSModel(ds; k_switching=2, intercept="switching")
Compute the autocorrelation of a dataset `ds` along the time dimension.
# Arguments
- `ds`: The input dataset.
- `lags`: The number of lags to compute autocorrelation for. Default is 30.
# Returns
The autocorrelation of the input dataset `ds` along the time dimension.
"""
function MSModel(ds; k_regime=2, intercept = "switching")

# Dimensions
indims = InDims("Ti")
outdims = OutDims(Dim{:MSM}(1))
# outdims = OutDims()

return mapCube(Climat.MSModel, ds, indims=indims, outdims=outdims, k_regime=k_regime, intercept=intercept, nthreads=Threads.nthreads())

end

0 comments on commit 4863651

Please sign in to comment.