[SOLVED] Extract the Gaussian anamorphosis?

If you have problems using RGeostats package or if you simply need some help on an unlisted subject.

[SOLVED] Extract the Gaussian anamorphosis?

Postby markm0705 » Mon Apr 15, 2019 4:22 am

When preparing the gaussian anamorphosis using the anam.fit() function - the function produces a plot of the polynomial fit and the input data. However, it is in some places hard to distinguish between the polynomial fit from the data as both plot in the same colour. Ideally, I would like to be able to extract the polynomial fit to a file (perhaps over a range of normal scores values) so I can plot the fit and the data cdf using R's other plotting tools. Is there a way to extract the polynomial fit or would I have to set up a function to do this from the '@hermite' values (which would might fun but somewhat tedious)?
Last edited by markm0705 on Tue May 28, 2019 9:51 am, edited 1 time in total.
markm0705
 
Posts: 22
Joined: Sun Mar 17, 2019 9:39 am

Re: Extract the Gaussian anamorphosis?

Postby Didier Renard » Tue Apr 16, 2019 9:18 am

Hello

As you can notice, when using anam.fit function, both the experimental and the fitted CDFs are plotted. For each one, you can use specific graphic parameters (see arguments of cdf.plot and anam.plot). Unfortunately we used the same arguments for both plots. So the user cannot distinguish between the two plots (changing the color line for example). This should be revisited in a future version.

For the time being I suggest the following workaround illustrated in a simple example:

Code: Select all
grid     = db.create(nx=c(100,100))               # Grid data set
model = model.create(vartype="Cubic",range=30)    # Creating a Cubic model
grid     = simtub(grid,model)                     # Non-conditional simulation
anam = anam.fit(grid)                             # Produce the anamorphosis from the initial variable and store in the object 'anam'


The previous command produces a graphic with the experimental CDF as well as the modelled CDF

Code: Select all
aux = db.create(nx=1000,dx=8/1000,x0=-4)    # Creating a regular 1D data set with X-coordinates varying from -4 to 4
aux = db.add(aux,z1=x1)                     # Duplicating the coordinate as the variable (Z-locator)
aux = anam.z2y(anam,aux)                    # Perform the transformation of the variable using the anamorphosis function


Then we can produce the new function as

Code: Select all
plot(aux[,"Gaus*"],aux[,3],cex=0,ylim=c(-1.8,3.6),type="l")


Hope this will help
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: Extract the Gaussian anamorphosis?

Postby markm0705 » Tue Apr 16, 2019 9:36 am

Didier

Thanks - the method you suggest looks relatively straightforward - I will give it a try and get back to this post if not successful

Regards
markm0705
 
Posts: 22
Joined: Sun Mar 17, 2019 9:39 am


Return to Other Troubleshooting

Who is online

Users browsing this forum: No registered users and 5 guests

cron