Skip to content

Error when trying to calculate 3 significance level at the same time #1

@Liu-Yitao

Description

@Liu-Yitao

I changed the No.101 line of the origin mtm-svd-python.py file from

sl = [.9]

to

sl = [0.99,0.95,0.9]

spectrum_1000

The upper pic is the output plot of the spectrum and the confidence level. The lines of confidence intersected.


Here is part 2 of the script

# 2) Compute the LVF


print('Apply the MTM-SVD...')

# Slepian tapers
nw = 2; # bandwidth
kk = 3; # number of orthogonal windows

o2 = var.copy().values

# Reshape the 2d array to a 1d array
o2ts = o2.reshape((o2.shape[0],o2.shape[1]*o2.shape[2]), order='F')
p, n = o2ts.shape

# Compute the LFV
[freq, lfv] = mtm_svd_lfv(o2ts,nw,kk,dt)

# Compute the confidence intervals
niter = 10000 # minimum of 1000 iterations
sl = [0.99,0.95,0.9]
[conffreq, conflevel] = mtm_svd_conf(o2ts,nw,kk,dt,niter,sl)

# Display the plot to allow the user to choose the frequencies associated with peaks
plt.plot(freq, lfv, '-', c='k')
plt.plot(conffreq, conflevel[0,:], '--', c='tab:red', label=str(sl[0]))
plt.plot(conffreq, conflevel[1,:], '--', c='tab:orange', label=str(sl[1]))
plt.plot(conffreq, conflevel[2,:], '--', c='tab:blue', label=str(sl[2]))
plt.xlim([0.01,.1])
plt.legend()
plt.savefig(f'./spectrum_{model}{niter}.png')
# plt.show()
plt.clf()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions