[R] Getting predictions for skewed t-distribution
Patrick Connolly
p_connolly at slingshot.co.nz
Fri Jul 3 11:17:49 CEST 2015
I have a small dataframe xxF, a summary of which looks like this:
> summary(xxF)
T Dev
Min. :10.44 Min. :0.008929
1st Qu.:10.44 1st Qu.:0.012048
Median :18.61 Median :0.031250
Mean :17.87 Mean :0.028286
3rd Qu.:22.24 3rd Qu.:0.041667
Max. :30.37 Max. :0.050000
I managed to make a non-linear fit after a lot of fiddling with
initial values but it looks overly complicated and biologically
unconvincing in part. The general form of a skewed t-distribution
looks more appropriate so I tried selm from the sn package thus:
> selmFt <- with(xxF, selm(Dev ~ T, family = "ST", method="MPLE"))
> coef(selmFt, param.type="DP")
(Intercept.DP) T omega alpha nu
-0.015895099 0.002689226 0.002306132 -5.660870446 1.473210455
I wish to get predictions for values of T between 10 and 32 but I can't
figure out how to use those coefficients.
With an linear model or glm, even without a prediction method, it's
fairly simple to get predictions from a range of values of the
independent variable/s. For a skewed-t it's evidently less
straightforward. Does it have to be done using CP type parameters?
Ideas gratefully accepted
In case it makes any difference....
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats4 grDevices utils stats graphics methods base
other attached packages:
[1] dplyr_0.3.0.2 nlmrt_2013-9.25 RColorBrewer_1.1-2 plyr_1.8.3
[5] stringr_1.0.0 reshape2_1.4.1 sn_1.2-2 lattice_0.20-31
loaded via a namespace (and not attached):
[1] Rcpp_0.11.3 assertthat_0.1 grid_3.2.1 DBI_0.3.1
[5] magrittr_1.0.1 stringi_0.4-1 lazyeval_0.1.10 tools_3.2.1
[9] numDeriv_2014.2-1 parallel_3.2.1 mnormt_1.5-3
--
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
___ Patrick Connolly
{~._.~} Great minds discuss ideas
_( Y )_ Average minds discuss events
(:_~*~_:) Small minds discuss people
(_)-(_) ..... Eleanor Roosevelt
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
More information about the R-help
mailing list