-


Kernel Density Estimate of Y



Download 460,19 Kb.
Pdf ko'rish
bet3/5
Sana17.05.2020
Hajmi460,19 Kb.
#52017
1   2   3   4   5
Bog'liq
Farnsworth-EconometricsInR

Kernel Density Estimate of Y

N = 25   Bandwidth = 1.386

Density

We can also plot the empirical CDF of a set of data using the ecdf() command from the stepfun library,

which is included in the default distribution. We could then plot the estimated CDF using plot().

> library(stepfun)

> d <- ecdf(y)

> plot(d,main="Empirical CDF of Y")

6.2

Contour Plots



The command contour() from the graphics package takes a grid of function values and optionally two vectors

indicating the x and y values of the grid and draws the contour lines. Contour lines can be added to another

plot using the contourLines() function in a similar manner. The lattice package provides a functions called

levelplot() and contourplot() that are more flexible but less simple to use in my experience. A contour

example appears in appendix 13.5.

6.3


Adding Legends and Stuff

After plotting we often wish to add annotations or other graphics that should really be placed manually.

Functions like text() (see below) and legend() take as their first two arguments coordinates on the graph

where the resulting objects should be placed. In order to manually determine the location of a point on the

graph, use the locator() function. The location of one or several right clicks on the graph will be returned

by this function after a left click. Those coordinates can then be used to place text, legends, or other add-ons

to the graph.

An example of a time series, with a predicted curve and standard error lines around it

31



> plot(a.true,type="l",lty=1,ylim=c(11.6,12.5),main="Predicted vs True",xlab="",ylab="")

> lines(a.predict$pred,lty=2,type="l")

> lines(a.predict$pred+a.predict$se,lty=3,type="l")

> lines(a.predict$pred-a.predict$se,lty=3,type="l")

> legend(145,11.95,c("true values","predicted"),lty=c(1,2))


Download 460,19 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish