- Timestamp:
- Jan 2, 2021 11:46:35 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath_new.py
r4693 r4699 274 274 Amatlam = Amat*(1.+np.eye(Amat.shape[0])*lam) 275 275 Ainv,nz = pinv(Amatlam,xtol) #do Moore-Penrose inversion (via SVD) 276 if nz > 0: G2fil.G2Print('Note: there are {} new SVD Zeros after drop' ,276 if nz > 0: G2fil.G2Print('Note: there are {} new SVD Zeros after drop'.format(nz), 277 277 mode='warn') 278 278 Xvec = np.inner(Ainv,Yvec)/Adiag #solve for LS terms -
trunk/GSASIIstrMain.py
r4693 r4699 60 60 if len(psing): 61 61 if msg: msg += '\n' 62 msg += '{} Parameters dropped due to singularities:'.format(len(psing)) 62 m = '{} Parameters dropped due to singularities:'.format(len(psing)) 63 msg += m 64 G2fil.G2Print(m, mode='warn') 65 m = '' 63 66 for i,val in enumerate(psing): 64 67 if i == 0: 65 msg += '\n\t{}'.format(varyList[val]) 68 msg += '\n{}'.format(varyList[val]) 69 m = ' {}'.format(varyList[val]) 66 70 else: 67 msg += ', {}'.format(varyList[val]) 68 G2fil.G2Print(msg, mode='warn') 71 if len(m) > 70: 72 G2fil.G2Print(m, mode='warn') 73 m = ' ' 74 else: 75 m += ', ' 76 m += '{}'.format(varyList[val]) 77 if i == 10: 78 msg += ', {}... see console for full list'.format(varyList[val]) 79 elif i > 10: 80 pass 81 else: 82 msg += ', {}'.format(varyList[val]) 83 if m: G2fil.G2Print(m, mode='warn') 69 84 #report on highly correlated variables 70 85 Hcorr = result[2].get('Hcorr',[]) 71 86 if len(Hcorr) > 0: 72 87 if msg: msg += '\n' 73 msg += 'Note highly correlated parameters:' 88 m = 'Note highly correlated parameters:' 89 G2fil.G2Print(m, mode='warn') 90 msg += m 74 91 elif SVD0 > 0: 75 92 if msg: msg += '\n' 76 msg += 'Check covariance matrix for parameter correlation' 77 for v1,v2,corr in Hcorr: 93 m = 'Check covariance matrix for parameter correlation' 94 G2fil.G2Print(m, mode='warn') 95 msg += m 96 for i,(v1,v2,corr) in enumerate(Hcorr): 78 97 if corr > .95: 79 98 stars = '**' 80 99 else: 81 100 stars = ' ' 82 m sg += '\n{} {} and {} (@{:.2f}%)'.format(101 m = ' {} {} and {} (@{:.2f}%)'.format( 83 102 stars,varyList[v1],varyList[v2],100.*corr) 103 G2fil.G2Print(m, mode='warn') 104 if i == 5: 105 msg += '\n' + m 106 msg += '\n ... check console for more' 107 elif i < 5: 108 msg += '\n' + m 84 109 if msg: 85 110 if 'msg' not in Rvals: Rvals['msg'] = ''
Note: See TracChangeset
for help on using the changeset viewer.