Nama : Diki Faisal Huda
Nim : 220605110058
Kelas : C
Mata Kuliah : Kalkulus
Dosen Pengampuh : Prof.Dr.Suhartono,M.Kom
Jurusan : Teknik Informatika
Universitas : UIN Maulana Malik Ibrahim Malang
Anda telah melihat operator kalkulus dasar, diferensiasi, yang diimplementasikan oleh fungsi R/mosaicCalc D(). Operator diferensiasi mengambil sebagai input fungsi dan variabel “sehubungan dengan”. Outputnya adalah fungsi lain yang memiliki variabel “sehubungan dengan” sebagai argumen, dan kemungkinan argumen lain juga.
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
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
f1 <- makeFun(sin(x ^ 2) ~ x)
f2 <- makeFun(sin(x ^ 2) + 3 ~ x)
f3 <- makeFun(sin(x ^ 2) - 100 ~ x)
f1(1)
## [1] 0.841471
f2(1)
## [1] 3.841471
f3(1)
## [1] -99.15853
df1 = D(f1(x) ~ x)
df2 = D(f2(x) ~ x)
df3 = D(f3(x) ~ x)
df1(1)
## [1] 1.080605
df2(1)
## [1] 1.080605
df3(1)
## [1] 1.080605
gaussian <-
makeFun((1/sqrt(2*pi*sigma^2)) *
exp( -(x-mean)^2/(2*sigma^2)) ~ x,
mean=2, sigma=2.5)
slice_plot(gaussian(x) ~ x, domain(x = -5:10)) %>%
slice_plot(gaussian(x, mean=0, sigma=1) ~ x, color="red")