Czarek Kowalski
2017-May-09 17:09 UTC
[R] Generating samples from truncated multivariate Student-t distribution
Dear Members, I am working with 6-dimensional Student-t distribution with 4 degrees of freedom truncated to [20; 60]. I have generated 100 000 samples from truncated multivariate Student-t distribution using rtmvt function from package ?tmvtnorm?. I have also calculated mean vector using equation (3) from attached pdf. The problem is, that after summing all elements in one column of rtmvt result (and dividing by 100 000) I do not receive the same result as using (3) equation. Could You tell me, what is incorrect, why there is a difference? Yours faithfully Czarek Kowalski -------------- next part -------------- A non-text attachment was scrubbed... Name: truncatedT.pdf Type: application/pdf Size: 197913 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20170509/a18ff86a/attachment.pdf>
David Winsemius
2017-May-09 19:40 UTC
[R] Generating samples from truncated multivariate Student-t distribution
> On May 9, 2017, at 10:09 AM, Czarek Kowalski <czarek230800 at gmail.com> wrote: > > Dear Members, > I am working with 6-dimensional Student-t distribution with 4 degrees > of freedom truncated to [20; 60]. I have generated 100 000 samples > from truncated multivariate Student-t distribution using rtmvt > function from package ?tmvtnorm?. I have also calculated mean vector > using equation (3) from attached pdf. The problem is, that after > summing all elements in one column of rtmvt result (and dividing by > 100 000) I do not receive the same result as using (3) equation. Could > You tell me, what is incorrect, why there is a difference?I guess the question is why you would NOT expect a difference between theory and a sample of realizations of RV's? The result mean should still be a random variable, night wahr?> Yours faithfully > Czarek Kowalski > <truncatedT.pdf>______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA
Czarek Kowalski
2017-May-09 20:11 UTC
[R] Generating samples from truncated multivariate Student-t distribution
Of course I have expected the difference between theory and a sample of realizations of RV's and result mean should still be a random variable. But, for example for 4th element of mean vector: 35.31 - 34.69571 = 0.61429. It is quite big difference, nieprawda?? I have expected that the difference would be smaller because of law of large numbers (for 10mln samples the difference is quite similar). On 9 May 2017 at 21:40, David Winsemius <dwinsemius at comcast.net> wrote:> >> On May 9, 2017, at 10:09 AM, Czarek Kowalski <czarek230800 at gmail.com> wrote: >> >> Dear Members, >> I am working with 6-dimensional Student-t distribution with 4 degrees >> of freedom truncated to [20; 60]. I have generated 100 000 samples >> from truncated multivariate Student-t distribution using rtmvt >> function from package ?tmvtnorm?. I have also calculated mean vector >> using equation (3) from attached pdf. The problem is, that after >> summing all elements in one column of rtmvt result (and dividing by >> 100 000) I do not receive the same result as using (3) equation. Could >> You tell me, what is incorrect, why there is a difference? > > I guess the question is why you would NOT expect a difference between theory and a sample of realizations of RV's? The result mean should still be a random variable, night wahr? > > >> Yours faithfully >> Czarek Kowalski >> <truncatedT.pdf>______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > David Winsemius > Alameda, CA, USA >
peter dalgaard
2017-May-10 19:09 UTC
[R] Generating samples from truncated multivariate Student-t distribution
It's not obvious to me that that marginal distribution of one component of a multivariate truncated t is the corresponding univariate truncated t. In fact, I would expect it to differ because of tail-dependence effects, e.g.> r <- rtmvt(1e5, c(30,0), diag(2), lower=c(29,-Inf), upper=c(31, +Inf), df=4) > sd(r[,2])[1] 1.191654> r <- rtmvt(1e5, c(30,0), diag(2), lower=c(35,-Inf), upper=c(37, +Inf), df=4) > sd(r[,2])[1] 3.504233 -pd> On 9 May 2017, at 19:09 , Czarek Kowalski <czarek230800 at gmail.com> wrote: > > Dear Members, > I am working with 6-dimensional Student-t distribution with 4 degrees > of freedom truncated to [20; 60]. I have generated 100 000 samples > from truncated multivariate Student-t distribution using rtmvt > function from package ?tmvtnorm?. I have also calculated mean vector > using equation (3) from attached pdf. The problem is, that after > summing all elements in one column of rtmvt result (and dividing by > 100 000) I do not receive the same result as using (3) equation. Could > You tell me, what is incorrect, why there is a difference? > Yours faithfully > Czarek Kowalski > <truncatedT.pdf>______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com