Estimate coefficients of a polynomial in Gaussian-based model: $$\mathrm{poly}(x, \alpha) N(x; \mu, \sigma^2)$$, where \(\alpha\) is a coefficient vector, \(\mu\) and \(\sigma\) are a mean and a standard deviation of Gaussian distribution: $$N(x; \mu, \sigma^2) :=\frac{1}{\sigma \sqrt{2\pi}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) $$
Using data
and optionally its frequencies freq
,
and a degree of a polynomial,
a mean mu
and a standard deviation sig
of Gausian distribution,
it computes the coefficients of a polynomial, along with
Akaike Information Criterion(AIC) and an accuracy information from
an underlying SDP solver.
In general, the smaller the AIC is, the better the model is.
An accuracy
around 1e-7
is a good indication for a computational
result of coefficients estimation.
Arguments
- deg
A degree of polynomial, which is positive even integer.
- mu
A mean of Gaussian distribution.
- sig
A standard deviation of Gaussian distribution, which is positive.
- data
A numeric vector of a data set to be estimated.
- freq
A numeric vector of frequencies for a data set
data
. The default value isNULL
, which indicates that all frequencies are equally one. Iffreq
is notNULL
, then it should be the same length asdata
, and all values should be positive integers.- verbose
If
TRUE
, it shows a detail information about SDP solver.- stepsize
It designates the stepsize for SDP solver. If the problem is easy, i.e., the number of a data set are small and a degree of a polynomial is small, then, for example,
0.9
might be ok. If it looks difficult, thenc(0.5, 0.3)
might work.
Examples
rlst <- gauss_est(4, 0, 1, mix2gauss$n200, NULL, FALSE, c(0.7, 0.4))
#> Status: Normal Termination.