Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Bug in enhanced_hdmr max_order=1 #642

Open
Labels
@willu47

Description

@willu47

When runningmorris.analyze.enhanced_hdmr withmax_order=1, an error is raised.

Traceback (mostrecentcalllast):File"/Users/wusher_1/repository/SALib/tests/test_enhanced_hdmr.py",line53,in<module>Si=enhanced_hdmr.analyze(problem,X,Y,**options)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/Users/wusher_1/repository/SALib/src/SALib/analyze/enhanced_hdmr.py",line232,inanalyzeSi=_finalize(hdmr,Si,alpha,return_emulator)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/Users/wusher_1/repository/SALib/src/SALib/analyze/enhanced_hdmr.py",line1439,in_finalizeTS=hdmr.S[r, :]^^^^^^AttributeError:'CoreParams'objecthasnoattribute'S'

The following code reproduces the error as seen in SALibv1.4.7:

importnumpyasnpfromSALib.analyzeimportenhanced_hdmrfromSALib.sampleimportlatin# Create a problem dictionaryproblem= {"num_vars":12,"names": ["PA|Agriculture|Kc","PA|Agriculture|Soil Water Capacity","PA|Agriculture|Root Zone Conductivity","PA|Agriculture|Runoff Resistance Factor","PA|Forest|Kc","PA|Forest|Soil Water Capacity","PA|Forest|Root Zone Conductivity","PA|Forest|Runoff Resistance Factor","PA|Grassland|Kc","PA|Grassland|Soil Water Capacity","PA|Grassland|Root Zone Conductivity","PA|Grassland|Runoff Resistance Factor",    ],"bounds": [        [0.8,1.4],        [300,600],        [2,8],        [.05,.5],        [.2,.4],        [150,900],        [2,5],        [.5,1.5],        [.6,1.3],        [250,600],        [3,7],        [0.1,1.2]    ]}X=latin.sample(problem,1000,seed=101)# Run the model to obtain Y (using randomly generated values)rng=np.random.default_rng()Y=rng.standard_normal(1000)# SALib-HDMR optionsoptions= {"max_order":1,"max_iter":100,"alpha":0.95,"print_to_console":True,"seed":101,}# Run SALib-HDMRSi=enhanced_hdmr.analyze(problem,X,Y,**options)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp