This class defines the Watson distribution. It provides methods for fitting the distribution to data and generating random samples.
Super class
midi::BaseDistribution
-> WatsonDistribution
Methods
Method new()
Creates a new Watson distribution.
Usage
WatsonDistribution$new(mu = c(0, 0, 1), kappa = 10)
Examples
wd <- WatsonDistribution$new(
mu = c(0, 0, 1),
kappa = 10
)
wd$get_axis()
#> [1] 0 0 1
wd$get_concentration()
#> [1] 10
wd$random(10)
#> [[1]]
#> [1] -0.13237162 0.02374105 0.99091580
#>
#> [[2]]
#> [1] 0.08423882 0.41784704 0.90460360
#>
#> [[3]]
#> [1] 0.7947338 -0.0201646 0.6066230
#>
#> [[4]]
#> [1] 0.08169297 0.07219491 0.99403931
#>
#> [[5]]
#> [1] 0.1757129 0.1309836 0.9756886
#>
#> [[6]]
#> [1] -0.107719805 -0.001532592 0.994180112
#>
#> [[7]]
#> [1] -0.08345784 -0.34058075 0.93650389
#>
#> [[8]]
#> [1] 0.02291961 -0.07663694 0.99679560
#>
#> [[9]]
#> [1] -0.1305185 0.1437479 0.9809697
#>
#> [[10]]
#> [1] 0.2882047 0.2054522 0.9352686
#>
wd$fit(wd$random(100))
wd$get_axis()
#> [1] 0.03407031 0.04412166 -0.99844504
wd$get_concentration()
#> [1] 9.508437