library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
##
## count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
## (status 2 uses the sf package in place of rgdal)
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
g <- D(x^2 ~ x)
g(1)
## [1] 2
## [1] 2
g(3.5)
## [1] 7
## [1] 7
7.1 Rumus dan Selisih Numerik Ketika ekspresi relatif sederhana dan terdiri dari fungsi matematika dasar, D()seringkali akan mengembalikan fungsi yang berisi rumus matematika. Misalnya pada contoh di atas
## function (x)
## 2 * x
## <bytecode: 0x0000024dac7938c0>
h <- D(sin(abs(x - 3) ) ~ x)
h
## function (x)
## {
## .e1 <- x - 3
## cos(abs(.e1)) * sign(.e1)
## }
## function (x)
## {
## .e1 <- x - 3
## cos(abs(.e1)) * sign(.e1)
## }
7.2 Parameter Simbolik dapat menyertakan parameter simbolik dalam ekspresi yang dimasukkan ke D(), misalnya:
s2 <- D(A * sin(2 * pi * t / P) + C ~ t)
s2
## function (t, A, C, P)
## (2 * A * pi * cos((2 * pi * t)/P))/P
## function (t, A, C, P)
## (2 * A * pi * cos((2 * pi * t)/P))/P
s2( t=3, A=2, P=10, C=4 )
## [1] -0.3883222
## [1] -0.3883222
slice_plot(s2(t, A=2, P=10, C=4) ~ t,
domain(t=range(0,20)))
7.3 Derivatif Parsial Turunan yang dihitung dengan D( )adalah turunan parsial . Artinya, mereka adalah turunan di mana variabel di sisi kanan ~diubah dan semua variabel lainnya tetap konstan.
7.3.1 Turunan kedua Turunan kedua hanyalah turunan dari turunan. Anda dapat menggunakan D( )operator dua kali untuk mencari turunan kedua, seperti ini.
df <- D(sin(x) ~ x)
ddf <- D(df(x) ~ x)
another.ddf <- D(sin(x) ~ x & x)
D(fred^2 ~ ginger)
## function (fred, ginger)
## 0
## function (fred, ginger)
## 0
pxy = D(x * sin(y) ~ x & y)
pyx = D(x * sin(y) ~ y & x)
Pilih beberapa (x,y) pasangkan dan evaluasi masing-masing fungsi turunannya. Gunakan hasilnya untuk menjawab yang berikut:
Parsial sehubungan dengan x dan untuk y identik. T atau F Parsial kedua sehubungan dengan x dan untuk y identik. T atau F Kedua campuran parsial identik. Artinya, tidak masalah apakah Anda membedakan terlebih dahulu sehubungan dengan x lalu y , atau sebaliknya. T atau F