-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraw_samples.py
More file actions
43 lines (39 loc) · 980 Bytes
/
draw_samples.py
File metadata and controls
43 lines (39 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#%%
from uqpylab import sessions
from access_UQCloud import Endpoint, Token
# The user's token to access the UQCloud API
# The UQCloud instance to use
#%%
# Start the session
mySession = sessions.cloud(host=Endpoint, token=Token)
# (Optional) Get a convenient handle to the command line interface
uq = mySession.cli
# Reset the session
mySession.reset()
# Specify the options for a bivariate normal random vector
InputOpts = {
'Marginals': [
{
'Type': 'Gaussian',
'Parameters': [0,1]
},
{
'Type': 'Gaussian',
'Parameters': [0,1]
}
]
}
# Create the bivariate normal random vector
myInput = uq.createInput(InputOpts)
# Draw 10 samples from the bivariate normal distribution
theSamples = uq.getSample(myInput, 10)
# %%[markdown]
# Storing your UQCloud credentials
#%%
mySession.save_config()
# %%
mySession = sessions.cloud()
uq = mySession.cli
mySession.reset()
mySession.quit()
# %%