Skip to content

Commit ecca24e

Browse files
committed
type handling
1 parent 2f7b716 commit ecca24e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SingularSpectrumAnalysis"
22
uuid = "77f5812f-bd1f-5f6e-9b72-07b28d8bbbc3"
33
authors = ["baggepinnen <[email protected]>"]
4-
version = "0.4.0"
4+
version = "0.4.1"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/SingularSpectrumAnalysis.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ function reconstruct(USV, trends, seasonal::AbstractArray)
9494
yrt, yrs
9595
end
9696

97-
function reconstruct(USV, groupings::AbstractArray)
97+
function reconstruct(USV::SVD{T}, groupings::AbstractArray) where T
9898
M = length(groupings)
9999
K,L = size(USV.U)
100100
N = K+L-1
101-
yr = zeros(N,M)
101+
yr = zeros(T,N,M)
102102
for m = 1:M
103103
X = elementary(USV,groupings[m])
104104
yr[:,m] = unhankel(X)
@@ -110,7 +110,7 @@ end
110110
trend, seasonal_groupings = autogroup(USV, th = 0.95)
111111
Try to automatically group singular values. `th ∈ (0,1)` determins the percentage of variance to explain.
112112
"""
113-
function autogroup(USV, th = 0.95)
113+
function autogroup(USV::SVD, th = 0.95)
114114
nS = USV.S .- minimum(USV.S)
115115
nS ./= sum(nS)
116116
cs = cumsum(nS)

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const SSA = SingularSpectrumAnalysis
6767

6868
yt, ys = analyze(yn, L, robust=false)
6969
A,x = fit_trend(yt, 1)
70-
@test x[2] 0.001 rtol = 1e-3
70+
@test x[2] 0.001 rtol = 1e-2
7171

7272
USV = hsvd(yn,L)
7373

0 commit comments

Comments
 (0)