chaospy icon indicating copy to clipboard operation
chaospy copied to clipboard

Uploading my samples to ChaosPy

Open ar-valdez opened this issue 6 years ago • 5 comments

Dear @jonathf ,

I have one question. Is it possible to upload "manually" samples to ChaosPy.

Usually the general code starts like this:

x = cp.Uniform(a,b) y = cp.Normal(a,b) dist = cp.J(x,y) samples = dist.sample(size=Ns)

and the variable samples its an array of samples for each variable x,y.

What I am trying to do is the following "Start my study, with samples that I have from a file" .... Is it possible to do this?

Its difficult to characterize the distribution that the data has. Therein I thought that if can upload the samples itself, I will bypass this problem.

Thanks you.

ar-valdez avatar Jul 10 '19 15:07 ar-valdez

Depends a bit on what you want to do, but most likely sure. E.g. you can use chaospy.SampleDist to intepret data as a distribution, and off you go.

I'll note though, a lot of what makes chaospy do what it does is that it leverages analytical properties of probability distributions and smoothness of a solution to get exponentially better results than going in blind. You remove that component, you rely solely on the accuracy of the data, reducing it to at best the level of Monte Carlo sampling.

jonathf avatar Jul 11 '19 10:07 jonathf

Dear @jonathf , Thanks for the rapid answer I see your point, Let me then ask you the following question:

So if I upload my own samples, I can be forced to loose the convergence that a PCE emulator has?

ar-valdez avatar Jul 11 '19 14:07 ar-valdez

I doubt you will loose convergence all together, just the fast speed of the convergence PCE usually offers. But I will note that I am not an expert on data driven PCE, so I might not be the best reference on this topic.

@flo2k, this is your topic more than mine. Do you have an overview of what to expect when using SampleDist compare to the traditional distributions?

jonathf avatar Jul 14 '19 06:07 jonathf

Thanks @jonathf I will then look references to study data drive PCE.

ar-valdez avatar Jul 14 '19 15:07 ar-valdez

Hi @jonathf ,

Right now, I don't have a detailed numerical analysis. I planned this a little bit for my thesis. But it should be in the range of Monte Carlo.

Best,

Florian

flo2k avatar Jul 14 '19 18:07 flo2k