Posted on Categories:Generalized linear model, 广义线性模型, 统计代写, 统计代考

# 统计代写|广义线性模型代写Generalized linear model代考|A Simulated Example

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 统计代写|广义线性模型代写Generalized linear model代考|A Simulated Example

Consider an NER model that can be expressed as
$$y_{i j}=\beta_0+\beta_1 x_{i j}+\alpha_i+\epsilon_{i j},$$

$i=1, \ldots, m, j=1, \ldots, n_i$, where the $\alpha_i$ ‘s are i.i.d. random effects with mean 0 and distribution $F_1$, and $\epsilon_{i j} \mathrm{~s}$ are i.i.d. errors with mean 0 and distribution $F_0$. The model might be associated with a survey, where $\alpha_i$ is a random effect related to the $i$ th family in the sample and $n_i$ is the sample size for the family (e.g., the family size, if all family members are surveyed). The $x_{i j}$ ‘s are covariates associated with the individuals sampled from the family and, in this case, correspond to people’s ages. The ages are categorized by the following groups: $0-4,5-9, \ldots, 55-59$, so that $x_{i j}=k$ if the person’s age falls into the $k$ th category (people whose ages are 60 or over are not included in the survey). The true parameters for $\beta_0$ and $\beta_1$ are 2.0 and 0.2 , respectively.

In the simulation, four combinations of the distributions $F_0, F_1$ are considered. These are Case I, $F_0=F_1=N(0,1)$; Case II, $F_0=F_1=t_3$; Case III, $F_0=$ logistic [the distribution of $\log {U /(1-U)}$, where $U \sim \operatorname{Uniform}(0,1)]$ and $F_1=$ centralized lognormal [the distribution of $e^X-\sqrt{e}$, where $X \sim N(0,1)$ ]; and Case IV, $F_0=$ double exponential [the distribution of $X_1-X_2$, where $X_1, X_2$ are independent $\sim$ exponential(1)] and $F_1=$ a mixture of $N(-4,1)$ and $N(4,1)$ with equal probability. Note that Cases II-IV are related to the following types of departure from normality: heavy-tail, asymmetry, and bimodal. In each case, the following sample size configuration is considered: $m=100, k_1=\cdots=k_{m / 2}=2$, and $k_{m / 2+1}=\cdots=k_m=6$. Finally, for each of the above cases, three prediction intervals are considered. The first is the prediction interval based on the LS estimator, or ordinary least squares (OLS) estimator of $\beta$; the second is that based on the EBLUE of $\beta$, where the variance components are estimated by REML (see Sect. 1.4.1); and the third is the linear regression (LR) prediction interval (e.g., Casella and Berger 2002, pp. 558), which assumes that the observations are independent and normally distributed. The third one is not related to the prediction interval developed here; it is considered for comparison.

For each of the four cases, 1,000 datasets are generated. First, the following are independently generated:
(i) $x_{i j}, 1 \leq i \leq m, 1 \leq j \leq k_i$, uniformly from the integers $1, \ldots, 12$ (12 age categories);
(ii) $\alpha_i, 1 \leq i \leq m$, from $F_1$;
(iii) $\epsilon_{i j}, 1 \leq i \leq m, 1 \leq j \leq k_i$, from $F_0$.

## 统计代写|广义线性模型代写Generalized linear model代考|CMMP of Mixed Effects

Suppose that we have a set of training data, $y_{i j}, i=1, \ldots, m, j=1, \ldots, n_i$ in the sense that their classifications are known, that is, one knows which group, $i$, that $y_{i j}$ belongs to. The assumed LMM for the training data is a logitudinal LMM (see Sect. 1.2.1.2):
$$y_i=X_i \beta+Z_i \alpha_i+\epsilon_i$$
where $y_i=\left(y_{i j}\right){1 \leq j \leq n_i}, X_i=\left(x{i j}^{\prime}\right)_{1 \leq j \leq n_i}$ is a matrix of known covariates, $\beta$ is a vector of unknown regression coefficients (the fixed effects), $Z_i$ is a known $n_i \times q$ matrix, $\alpha_i$ is a $q \times 1$ vector of group-specific random effects, and $\epsilon_i$ is an $n_i \times 1$ vector of errors. It is assumed that the $\alpha_i$ ‘s and $\epsilon_i$ ‘s are independent, with $\alpha_i \sim N(0, G)$ and $\epsilon_i \sim N\left(0, R_i\right)$, where the covariance matrices $G$ and $R_i$ depend on a vector $\psi$ of variance components.

Our goal is to make a classified prediction for a mixed effect associated with a set of new observations, $y_{\mathrm{n}, j}, 1 \leq j \leq n_{\text {new }}$ (the subscript $\mathrm{n}$ refers to “new”). Suppose that the new observations satisfy a similar LMM:
$$y_{\mathrm{n}, j}=x_{\mathrm{n}}^{\prime} \beta+z_{\mathrm{n}}^{\prime} \alpha_{\mathrm{I}}+\epsilon_{\mathrm{n}, j}, \quad 1 \leq j \leq n_{\mathrm{new}},$$
where $x_{\mathrm{n}}, z_{\mathrm{n}}$ are known vectors; the index $I$ is assumed to be one of $1, \ldots, m$, but one does not know which one it is, or even whether such an actual “match” exists (i.e., it may not be true, at all, that $I$ matches one of the indexes $1, \ldots, m$ ). Furthermore, $\epsilon_{\mathrm{n}, j}, 1 \leq j \leq n_{\text {new }}$ are new errors that are independent with $\mathrm{E}\left(\epsilon_{\mathrm{n}, j}\right)=$ 0 and $\operatorname{var}\left(\epsilon_{\mathrm{n}, j}\right)=R_{\mathrm{new}}$ and are independent with the $\alpha_i \mathrm{~s}$ and $\epsilon_i \mathrm{~s}$ associated with the training data. Note that the normality assumption is not always needed for the new errors, unless prediction interval is concerned (see below). Also, the variance $R_{\text {new }}$ of the new errors does not have to be the same as the variance of $\epsilon_{i j}$, the $j$ th component of $\epsilon_i$ associated with the training data. The mixed effect that we wish to predict is
$$\theta=\mathrm{E}\left(y_{\mathrm{n}, j} \mid \alpha_I\right)=x_{\mathrm{n}}^{\prime} \beta+z_{\mathrm{n}}^{\prime} \alpha_{\mathrm{I}}$$

## 统计代写|广义线性模型代写Generalized linear model代考|A Simulated Example

$$y_{i j}=\beta_0+\beta_1 x_{i j}+\alpha_i+\epsilon_{i j},$$

$i=1, \ldots, m, j=1, \ldots, n_i$，其中$\alpha_i$为均值为0，分布为$F_1$的i.i.d随机效应，$\epsilon_{i j} \mathrm{~s}$为均值为0，分布为$F_0$的i.i.d误差。该模型可能与一项调查相关联，其中$\alpha_i$是与样本中的$i$个家庭相关的随机效应，$n_i$是该家庭的样本量(例如，如果调查了所有家庭成员，则为家庭规模)。$x_{i j}$是与从家庭中抽样的个体相关的协变量，在这种情况下，对应于人们的年龄。年龄按以下组分类:$0-4,5-9, \ldots, 55-59$，因此，如果该人的年龄属于$k$第一类(年龄在60岁或以上的人不包括在调查中)，则$x_{i j}=k$。$\beta_0$和$\beta_1$的true参数分别为2.0和0.2。

(i) $x_{i j}, 1 \leq i \leq m, 1 \leq j \leq k_i$，统一从整数$1, \ldots, 12$(12个年龄类别);
(ii) $\alpha_i, 1 \leq i \leq m$，原$F_1$;
(iii) $\epsilon_{i j}, 1 \leq i \leq m, 1 \leq j \leq k_i$，原$F_0$。

## 统计代写|广义线性模型代写Generalized linear model代考|CMMP of Mixed Effects

$$y_i=X_i \beta+Z_i \alpha_i+\epsilon_i$$

$$y_{\mathrm{n}, j}=x_{\mathrm{n}}^{\prime} \beta+z_{\mathrm{n}}^{\prime} \alpha_{\mathrm{I}}+\epsilon_{\mathrm{n}, j}, \quad 1 \leq j \leq n_{\mathrm{new}},$$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。