Learn R Programming

CircNNTSR (version 2.0)

snntsdensityplot: Plots a SNNTS density for spherical data

Description

Computes the points needed to plot the SNNTS density function for spherical data

Usage

snntsdensityplot(long, lat, cpars = 1, M = c(0,0))

Arguments

long
Grid for longitude. Vector with values between 0 and 2*pi
lat
Grid for latitude. Vector with values between 0 and pi
cpars
vector of complex numbers of dimension prod(M+1). The first element is a real and positive number. First M[1]+1 elements correspond to longitude, next M[2]+1 elements correspond to latitude. The sum of the SQUARED moduli of the c parameters must be eq
M
vector with number of components in the SNNTS for each dimension
...
arguments passed to function plot

Value

  • The points needed to plot the SNNTS density function

References

Fernandez-Duran J. J. y Gregorio Dominguez, M. M. (2008) Spherical Distributions Based on Nonnegative Trigonometric Sums, Working Paper, Statistics Department, ITAM, DE-C08.6

Examples

Run this code
data(Datab6fisher_ready)
data<-Datab6fisher_ready
M<-c(4,4)
cest<-snntsmanifoldnewtonestimation(data, M)
cpars<-cest$cestimates[,3]
longitud<-seq(0,360,2)*(pi/180)
latitud<-seq(0,180,1)*(pi/180)
z<-outer(longitud,latitud,FUN="snntsdensityplot",cpars,M)
persp(longitud,latitud,z,theta=45,phi=30)
contour(longitud,latitud,z)
points(data[,1],data[,2])

Run the code above in your browser using DataLab