# Cross-Validation
During my current course 'Data Anaylsis and Interpretation', in which our course instructors are Image processing specialists we have worked on several interesting assignments on this topic and implemented them in MATLAB. One of them was the PDF Estimator where we compared various non parametric estimation techniques like histogramming and Kernel Density Estimation and implemented cross-validation procedure, an application of Machine Learning. In another problem, we were given two {\it Magentic Resonance Images} (MRIs) of a portion of human brain, acquired with different settings of the MRI machine. After casting the images as a double array, we were asked to shift the second image by various amounts and for each compute the correlation coefficient (CC) and quadratic mutual information (QMI) for the first image and shifted versions of second image. The major point was to realise after several plots was that QMI is a much stronger indicator than the CC and anaylze why so.
Problem Statement:
We have extensively seen parametric PDF estimation in class via maximum likelihood. In many situations, the
family of the PDF is however unknown. Estimation under such a scenario is called nonparametric density es-
timation. We have studied one such technique in class, namely histogramming, and we also analyzed its rate
of convergence. There is another popular technique for nonparametric density estimation. It is called KDE or
Kernel density esitmation, the formula for which is given as ˆpn(x; σ) =
Pn
i=1 exp (−(x − xi)
2/(2σ
2
))
nσ√
2π
. Here ˆpn(x)
is an estimate of the underlying probability density at value x, {xi}
n
i=1 are the n samples values, from which the
unknown PDF is being estimated, and σ is a bandwidth parameter (similar to a histogram bin-width parameter).
The choice of the appropriate σ is not very straightforward. We will implement one possible procedure to choose
σ - called cross-validation. For this, do as follows:
(a) Use MATLAB to draw n = 1000 independent samples from N (0, 16). We will use a random subset of 750
samples (set T) for building the PDF, and the remaining 250 as the validation set V . Note that T and V
must be disjoint sets.
(b) In your report, write down an expression for the joint likelihood of the samples in V , based on the estimate
of the PDF built from T with bandwidth parameter σ
(c) For different values of σ from the set {0.001, 0.1, 0.2, 0.9, 1, 2, 3, 5, 10, 20, 100}, write MATLAB code to evaluate
the log of the joint likelihood LL of the samples in V , based on the estimate of the PDF built from T. Plot
of a graph of LL versus log σ and include it in your report. In the report, state which value of σ yielded the
best LL value, and print it via your code as well. This procedure is called cross-validation.
(d) In this experiment, we know the ground truth pdf which we shall denote as p(x). So we can peek into
it, in order to choose the best σ. This is impractical in actual experiments, but for now it will serve as a
method of comparison. For each σ, write MATLAB code to evaluate D =
P
xi∈V
(p(xi) − pˆn(x; σ))
P
2 D =
xi∈V
(p(xi) − pˆn(xi
; σ))2
. Plot of a graph of D versus log σ and include it in the report. In the report, state
which value of σ yielded the best D value, and also what was the D value for the σ parameter which yielded
the best LL.
HOW TO RUN MY CODE:
Run cross.m and the plots will be generated. Sample plots are given
没有合适的资源?快使用搜索试试~ 我知道了~
核密度非参数估计的matlab代码-Cross-Validation:交叉验证
共3个文件
md:1个
png:1个
m:1个
5星 · 超过95%的资源 需积分: 37 21 下载量 36 浏览量
2021-06-02
16:38:45
上传
评论 2
收藏 102KB ZIP 举报
温馨提示
核密度非参数估计的matlab代码交叉验证 在我目前的课程“数据分析和解释”中,我们的课程讲师是图像处理专家,我们已经完成了关于这个主题的几个有趣的作业,并在 MATLAB 中实现了它们。 其中之一是 PDF 估计器,我们在其中比较了各种非参数估计技术,如直方图和核密度估计,并实现了交叉验证程序,这是机器学习的一种应用。 在另一个问题中,我们获得了部分人脑的两个 {\it Magentic Resonance Images} (MRI),这些图像是通过 MRI 机器的不同设置获得的。 在将图像转换为双阵列后,我们被要求以不同的量移动第二张图像,并为每个图像计算第一张图像和第二张图像的移位版本的相关系数 (CC) 和二次互信息 (QMI)。 主要的一点是在几次绘图后意识到 QMI 是一个比 CC 强得多的指标,并分析为什么会这样。 问题陈述: 我们已经通过最大似然在课堂上广泛地看到了参数 PDF 估计。 在许多情况下, 然而,PDF 的家族是未知的。 这种情况下的估计称为非参数密度估计。 我们在课堂上研究了一种这样的技术,即直方图,我们还分析了它的比率 的收敛。 还有另一种流行的非参数密
资源详情
资源评论
资源推荐
收起资源包目录
Cross-Validation-master.zip (3个子文件)
Cross-Validation-master
plots.png 108KB
README.md 3KB
cross.m 1010B
共 3 条
- 1
weixin_38657290
- 粉丝: 5
- 资源: 943
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论5