Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Liu-Yitao opened this issue Dec 6, 2021 · 1 comment

Comments

@Liu-Yitao
Copy link

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()
@mathildejutras
Copy link
Owner

mathildejutras commented Dec 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants